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.
The German sailors mutinied in 1918 after it became known that the German High Seas Fleet should sail towards England and challenge the Royal Navy to a fight in order to a) determine the winner of the war or b) die in the attempt of winning said battle. The German sailors chose not to commit to "mass-suicide by
cop Royal Navy".
But there are two other examples for similar action, both from the Soviet Baltic Fleet. The first is that of Jonas Pleškys (a Lithuanian), captain of a submarine tender, who sailed his ship to Sweden. He asked for political asylum in Sweden and was then exfiltrated by the CIA. Sources claim, he wanted to sail to Talinn, then in the USSR, however.
The second example is that of the Soviet frigate Storozhevoy, a Krivak class vessel. The political commissar, one Captain Valery Sablin, detained the ship's captain, convinced the majority of the officers and almost all of the enlisted sailors to sail to Leningrad and broadcast a protest from aboard the old protected cruiser Aurora (a symbol for the original Russian Revolution) against the corruption of the Brezhnev era. The mutiny was discovered, before the ship left port, and subsequently all plans had to be rushed. The Storozhevoy left for Leningrad and was hunted down by half the Baltic fleet, including 60 warplanes. The frigate was attacked repeatedly, until she lay dead in the water, after which she was boarded. At that point the crew had already counter-mutined, freed the captain and non-fatally shot Captain Sablin. Captain Sablin was sentenced to death, his second in command, an enlisted sailor, was sentenced to eight years in prison and the rest of the mutinous crew was dishonorably discharged from the navy.
I think, both examples show the problems of mutiny on that scale, especially if one wants to take over a whole ship and sail it to some place else (which the German sailors never tried).
Nota bene: Both incidents from Soviet history together were merged by Tom Clancy into the plot of
The Hunt for Red October.