Periscope Depth on the open ocean
Submarines in late WW2 were designed to handle overpressures of 20 bar (2.11169 MPa) at depths of 200 to 280 metres (660 to 920 feet). (Crush depths) Structures that strong can easily handle the pounding that a very large wave is going to dump on it. The humans inside the submarine won't like the jostling but the sub will survive. The shallow turbulence from the crashing waves is what the submariners feel at depth. The sub itself isn't in any danger.
Remember that submarines aren't designed with a hull shape that induces rotational stability like surface ships do.
Shallow waters are a different story
Because of the turbulence from very large waves from these megastorms, the waves may be large enough to force a sub to drop further in the water column than it should. If the ocean bottom is too close then the sub may crash. The exact effects will depend on ocean bottom composition, angle of impact, speed of impact and luck.
Shallow water during a storm would be dangerous to a WW2-era submarine.