Could a pressure relief valve that drains up cause my water heater to explode?
A pressure relief valve does (or should) what it says: relieve pressure. That is exactly what you want - in the unlikely but non-zero event that a water heater overheats or has some other problem causing the water inside to get very hot (which leads to high pressure) or to get to much higher than normal pressure, the valve opens to relieve the pressure.
Normally I see the pipe from a pressure relief valve going down. It looks like the pipe in the picture goes sideways and then down, presumably to a drain outside.
If I understand the drawing correctly, the hypothetical part here is not &quot;existence of the valve&quot; but rather &quot;pipe going straight up from the valve.&quot; That is not a good idea. Under normal circumstances, water pressure can handle any direction. But in the case of an over-temperature/over-pressure situation, you want the water to specifically go out the easiest path possible. If the pressure relief valve piping extends above other pipes, it is quite possible that even after the valve opens, the water will try to exit via other means - the pipes at the top of the water heater - which could lead to burst pipes or other problems.
One extra safety feature that may make sense is a water heater drain pan. This goes underneath your water heater to catch leaks. It is typically required when a water heater is not on the lowest level, but even on the lowest level of your house it is a good idea if there is no floor drain nearby.