The Horatio Hornblower novels suggest that a Royal Navy captain whose ship is alone at sea could order pretty much anything, and see it done. But I'm pretty sure, I have to suppose, that if he hanged a crewman there would be a formal inquiry when he got back to England. And the invention of radio changed everything.
No. I don't recall anything in Hornblower that would imply that, but if there was it was wrong. There was a well-established legal code that specified which offenses a captain could punish on his own authority, which offenses had to be tried by court martial, and the sentences that could be imposed. Mutiny was a court martial offense.
Because a court martial at the time required a board of at least five captains, offenders were often transported back to Britain from overseas stations for trial. That's what HM frigate
Pandora was doing with some of the
Bounty mutineers when she was wrecked in 1791.
Captains who imposed punishments outside the law would themselves be committing an offense. In one case in 1807 the captain of HM sloop
Recruit marooned a sailor on a Caribbean island as punishment for theft. The sailor was picked up by a merchant ship and when the story came out the captain was court martialed and dismissed from the service.
What radio changed the most was operational, so admirals in England could get involved (some would say interfere) in what fleets and ships were doing all over the world, where commanders on the spot had before had much more authority and leeway to make important decisions on their own stations.
That would seem to repeat the very crime Mackenzie was accused of.
It would actually be worse, since the captain of
Somers did have legal jurisdiction for the crew, whereas the secretary of war would have no jurisdiction over a naval officer.