Large ocean waves are not a problem underwater usually. I have been under many hurricanes in the Atlantic. Under a category 5, under the eye, we took only 12 degree rolls, so slow that it felt like mom was rockin' us to sleep. This was at 400 feet deep though. I did not understand why we didn't bother going more than twice that deep.
South of Africa, the Fast Attack (smaller) submarines can get slammed so hard that they can literally go from periscope depth to test depth and back in brief moments. There are few things in life less scary.
Mom had that problem once when she took off in her Piper Cherokee and ended up in a dust-devil mini-tornado. She was slammed back and forth as much as 800 feet up and down in altitude, but started out only a little bit above 1000 feet to begin with.
At PD (periscope depth, very shallow) the USS Pennsylvania {18,750 tons, 562 feet steel tube four stories tall in the center, 6 stories with the sail [vertical fin]} was caught by a rogue wave.
An officer and an enlisted man were at the top of the sail, tied down to prevent from being washed overboard {tied down to 18,750 tons}. They had to hold their breathe for nearly 3 minutes until until the Pennsylvania managed to get back to the surface.
Straight down the sail on a Trident submarine is the control room where the OfficerOnDeck & the people that coordinate the sub's movement all operate.
A column of water over 3 feet wide poured down the sail, for nearly 3 minutes. This begins to flood and SINK your submarine. A junior sailor driving the boat pulled 'the chicken switches' which allow us to emergency blow from depths deeper than test depth.
This maxed out the buoyancy of the Pennsylvania and sent her to the surface fast enough to save the two submariners topside on the sail.
Those two medically quit submarine service after that, scarred/scared for life.