Long distance communication with submarines is difficult but not impossible, there are four extra low frequency transmitters in the world to send signals in nuclear doomsday scenarios.
For shorter distances, there are acoustic and optical devices, and near surface some low frequency radios can be used.
https://en.m.wikipedia.org/wiki/Communication_with_submarine...