The original Star Trek was explicitly pitched as heartening back to the age of sail. And it was an exploration vessel, not tied to a fleet. So you’d look to Captain Cook as an historical parallel: the
Captain was a combination of chief scientist, diplomat, and strategist. And indeed Cook died in an onshore altercation that left his final expedition in a precarious situation.
Picard was much closer to a modern naval captain: his ship had a clear chain of command and it was part of the plot that his xo did the dangerous expeditions so he could remain in command of the overall mission.
I would add that Eisenhower was a general of generals in d day. Generals closer to the action would sometimes find themselves in danger. For example Roosevelt Jr landed under fire and received the Medal of Honor. And for ship captains that was quite a bit more true.