You can extend Dialog class and override dispatchTouchEvent() method.
EDIT: Also you can implement Window.Callback interface and set it as dialog's window callback using dialog.getWindow().setCallback(). This implementation should call corresponding dialog's methods or handle events in its own way.