Yes but that would be wildly inefficient. A nuke on the ground ("lay-down" delivery) is already maybe 40% as powerful as one in the air. Put it under even a few feet of water and that becomes only 20% as most of the energy goes sideways/down through water/dirt rather than directly at the target buildings. Water is shockingly dense at scale.