I suspect that warship crews are vetted for things like that. Besides, it's a lot harder to convince enough of a crew to defect. In real life, individual infantrymen have defected or deserted, but I can't recall a warship ever changing sides. The only full mutiny I've heard of was the HMS Bounty. There have been a few other cases where junior officers relieved the captain, but they didn't leave their navy.
Edit: Now that I think about it, at least one Russian flagship, the Potemkin, declared for the revolution when the the Romanovs fell. But that was more of a mutiny than a defection and it was backed by a very visible civilian uprising. And during WW1, a sizable number of German sailors rioted toward the end of the war after being confined in their ships and seeing no action for months.