Correct me if my understanding is wrong. but what we have here in Starship is a LOX header tank in the nose. After that we have a large empty space in the nose cone which will ultimately be either cargo or human habitat depending on craft version and design. After that we have the methane tank. Between the primary methane tank and the bottom LOX tank, we have the methane header tank. Finally, we have the primary LOX tank and then engines and landing gear at the bottom. The LOX header is in the nose for ballast/balance reasons, since O2 is heavier than CH4 and serves to counterbalance the mass of the engines at the rear.
So there are two header tanks, and two primary tanks.
The task of the primary tanks is to provide fuel for launch and acceleration operations in flight, and to provide fuel storage and plumbing facilities for orbital fuel transfer operations.
The task of the header tanks is to provide fuel for post-belly-flop landing maneuvers, so that the tank is full and slosh is minimized for reliable delivery to the turbopumps.
SpaceX has said before that they intend to expose the primary tanks to vacuum during routine spaceflight. This is supposed to help insulate the header tanks so that their cryogenic payload is easier to maintain on their limited electrical budget in the vehicle. Obviously they had neither the time nor the altitude to accomplish that here, and suffered from an artificially imposed altitude ceiling from the flight plan. They cannot safely burn 100% of the fuel in the primary tanks without damaging the engine turbopumps, and they cannot vent the tanks in Earth atmosphere during the belly flop since there is neither time nor ecological willpower to spray methane into the atmosphere. So these low altitude test flights and landings will all suffer from the drawback of having residual fuel in the primary tanks.
So on a real flight, an energetic explosion like this is considerably less likely because the primary tanks would be empty.
But:
One would hope that the primary tanks are not holding vacuum during reentry to Earth or Mars. Hopefully they're sucking ambient atmosphere in to maintain neutral pressurization during reentry, or being gently pressurized by a suitable inert gas during descent. A jarring impact like seen during yesterday's landing would result in a vacuum container crumpling much more easily than a container at one atmosphere of pressure. And while Raptor offers autogenous pressurization of its fuel tanks via exhaust recirculating, apparently it does not offer enough spare exhaust to 100% pressurize the header tanks without assistance from nitrogen COPV's right now. So it certainly cannot pressurize the much larger primary tanks with O2 or CH4 exhaust from the respective preburners.