Firstly, Submarine is not used to attack navy base, that is suicide in modern warfare;
Secondly, if Vietnam starts to attack Chinese naval base, then it is no longer a conflict but war. In such a scenario, Chinese can also attack all of Vietnam military bases, it is not good to Vietnam at all...