If it's a real submarine, the typical thin-walled round or even rectangular tube keel cooler would be crushed at modest depth. Bringing the high pressure seawater inside the pressure hull would allow use of somewhat thinner pipe. Either way, you need sturdy stop valves at the hull.
I can conjecture a couple other ways to transfer heat through a pressure hull, but I don't know how it's actually typically done... and I'm embarrassed to admit that I probably should know.
Mike Halloran
Pembroke Pines, FL, USA