Praise be to Allaah.
the accident is major and serious, then it is OK to stop one’s prayer;
if it is a minor incident that can be dealt with after completing the
prayer, then it is not permissible. The scholars said: it is obligatory to
stop one's prayer in order to save a negligent person from a fatal
accident. For example, if you are praying and you see a snake approaching
a man who is sitting down and has not noticed it. If it is heading for
him, you have to stop your prayer and tell him so that he will not be
bitten, possibly fatally. Or if you see a blind man walking in front of
you whilst you are praying, and he is heading towards a well, and you are
afraid that he may fall into it, then you have to stop your prayer and
save him from that fatal accident, even if this means stopping your
prayer. The same applies in cases of fire, etc.