It depends on the universe.
The problem with spaceships going underwater is that they are usually built to do only one thing. One of the most famous scenes from Futurama is when the crew's spaceship sinks into the ocean:
Prof. Farnsworth: Dear Lord, that's over 150 atmospheres of pressure!
Fry: How many atmospheres can this ship withstand?
Prof. Farnsworth: Well it's a spaceship, so I'd say anywhere between zero and one.
The Leviathans, biomechanoid ships in the Farscape stories, were able to survive going and maneuvering underwater while not being exactly pressure–tight from the outside.
However, there are plenty of spaceships in fiction which are built for higher pressure levels. Here are just a few examples. This list is by no means exhaustive.
The Leviathans, biomechanoid ships in the Farscape stories, were able to survive going and maneuvering underwater while not being exactly pressure–tight from the outside.
In X-Com: Terror From The Deep, the aliens assaulting Earth live on the bottom of the oceans. The final base to be stormed is at the Mariana Trench. Their ships work both abyssal depths and in space.
The Deep Angel Supercav online sci fi series had supercavitating fighters that could be deployed both in space and underwater.
In Michael Crichton's Sphere, a spaceship from the future is sunk at around 300m, but still manages to go to space.
In the Star Wars universe, the Trident-class assault ship can travel underwater and in space.
In the Masters or OrionMasters or Orion series of videogames, the Trilarians are an aquatic race that builds their cities underwater - therefore their ships are launched from water to space.
In Flight of the NavigatorFlight of the Navigator the ship Trimaxion Drone ShipTrimaxion Drone Ship goes underwater.
And so on, with more and more underwater scifi being added every year.