Yes, and when the Vietnamese sink a Chinese ship they will nuke Hanoi and Haiphong. And invade with a two million man army lusting for blood. A sub isn’t the answer to all of Vietnams problems.
China won'r nuke anyone before they are ready to nuke the USA, or make the attempt. China won't invade Việt Nam on land. The Great Chinese Victory of 1979 was a severe warning that invading Việt Nam is a very expensive proposition and not cost effective. I would expect that China would, however conventionally attack Cam Ranh from the sea or the air to destroy naval facilities. I would not venture to predict the ensuing activity, however. A naval war in the East Sea would probably end up with the Vietnamese navy being pretty much wiped out but with some heavy damages to Chinese assets. China/Việt Nam is not quite the boot/bug proposition that it would seem to resemble on the map.