It’s international waters. What “government” are you referring to?
If a ship or submarine does not register to any country, I think most coast guards will assume it to be pirates or drug smugglers. And they will probably surrender and arrest anyone on board or sink you if it comes to that.