It is correct to say that submarines and spacecraft both have to deal with operating an enclosed craft in an unforgiving external environment. But the actual engineering is VERY different.
For example, subs are designed to take a lot of pressure (thousands of psid) from outside. Spacecraft, meanwhile, only have to deal with the (relatively) small differential between the inside atmospheric pressure and vacuum. The stresses and necessary construction are totally different.
Submarines are highly concerned with hydrodynamics, but you could fly a jagged ball of bricks in space with zero aerodynamic concerns as long as you have thrusters to deal with the Newtonian physics of steering and momentum. Unless you want to re-enter atmosphere, which is a whole other conversation...
Most submarines also can only efficiently move in one direction: forward. The little APU that large subs use for docking doesn't count, unless you want to call that similar to a maneuvering thruster on a spacecraft. Spacecraft with properly placed thrusters have no such limitation, and can generally move any direction at will.
Spacecraft are highly concerned with radiation and electromagnetic effects, not to mention impacts from meteors and space junk. Submarines obviously have no such issue.
Submarines need sonar to see where they're going, and place great emphasis on stealth. Sight range in spacecraft is limited only by the power of optics and radar. There's very little to hide behind in space, and "stealth" is somewhere between difficult and nearly impossible, depending on how much effort you put into it.
So yeah, there are definitely naval parallels, but there are also vast differences.
_________________
Be careful what you wish for. I might let you have it.