This question comes from Jason, who asks: How long could a nuclear submarine last in orbit?
The answer is "not very long," but not for the reason I expected. The submarine wouldn't burst.
Submarine hulls are strong enough to withstand 50 to 80 atmospheres of external pressure from water, so they'd have no problem containing one atmosphere of internal pressure from air. And the hull would likely be reasonably airtight.
Although watertight seals don't necessarily hold back air, the fact that water can't find a way through the hull under 50 atmospheres of pressure suggests that, when the sub is in space, air won't escape quickly.
Dangerous carbon dioxide buildup wouldn't be an issue as submarines use CO2 scrubbers that can be run indefinitely as long as they have power.
But oxygen is another story: nuclear submarines use electricity to extract oxygen from water. In space, there's no water, so they wouldn't be able to manufacture more air.
They carry enough oxygen in reserve to survive for a few days at least, but eventually they'd be in trouble.
The really big problem, though, would be overheating, because space is much warmer than the ocean. If you're pedantic, that's not really true. Space is of course very cold.
But if you're even more pedantic (and I am), it is true – in two different ways! Space in Earth orbit seems cold because it's so empty.
Without a warm environment around you radiating heat back to you, you lose heat by radiation much faster than normal. But space in earth orbit is actually warm.