If one turns over on it's side, pipes (such as injector feed lines and boiler check valves, steam feeds to the injectors, blowoff cocks, whistle, etc), will probably get get knocked off, and The boiler will be blowing itself down pretty quickly via whatever broken off piping can release boiler pressure. (That is why there is often a shutoff valve on the niggerhead in the cab with the handle extending thru the top of the cab roof which can be used to shut down all steam feeds from that source, assuming anyone is left alive and able to get to it and do something with it).
On a coal burner, The fire and the grates would be dumped, and since firing will cease, and cold air will enter where the grates were, the fire will pretty quickly burn down to where it won't do much other damage. An oilburner would most likely have the brickwork dumped and the oil supply interrupted to the firebox, but possibly ignited from something hot external to it, and cause a pretty good fire all around anyway.
If the throttle is still open, Water will enter the dry-pipe and flood the cylinders, bringing things to a halt there.
Bottom line is, you don't want to be still in the cab when one turns over...
If you get caught under it, you're probably gone, but those that were just trapped in the escaping steam/water flashing to steam environment mostly weren't around very much longer to tell about it.
Being scalded to death is not my idea of a good way to go.