The answers provided are almost entirely right.
Sailing requires two mediums. Absolutely correct, however, it is extremely important to define "medium". More specifically, if we take two control volumes, the medium inside - does it have the same density, velocity, composition, energy etc.?
Conservation laws state, in laymans terms: You can't get something from nothing.
Sailing works, because sailboats actually have at least two sails: one in the air, one in the water. A sailboat can tack faster than the wind, because it works on the principle of transfering energy between the two. In the process, part of the energy is siphoned and converted into boat speed.
Adding the two concepts together, in general terms - in order to "sail", we need two sails in different control volumes, which have different properties. Next we initiate energy transfer between the two sails and siphon part of the energy into our vehicle.
Returning to the OP: Can a sub sail underwater?
Can we find two different "medium" underwater? Yes!
- Anyone who has gone swimming in a lake in early summer, can recall, that the surface is nice and warm, but a few meters down, the water rapidly gets icy cold.
- A popular photo of an ocean with a clear boundary between fresh water and salt water.
- Current - underwater current is similar to a river in water - it moves in a different direction and/or speed, compared to the rest of the water.
The point is - water can have different properties with very pronounced boundaries. Sailing requires a difference in velocities, but if you can find that difference in velocities underwater, you can put two sails on a sub an sail these boundaries. The exact speed we can achieve requires calculation.