Suppose there is crash in any application and some dialog box appears.It will block all other applications until someone acknowledge this.
Well, if it's blockiing all other applications, it's either an important OS message, or a poorly-written appliccation. A dialog box from one application should not block unrelated applications from processing.
You can do what you want to do, but it would take a lot of forethought, effort, and caution to implement. It would be very easy for something like this to go sideways on you at the worst possible moment.