Days of Sail - Edward Pellew
Sir Edward Pellew was a successful captain whose exploits were used as the basis for a number of fictional characters. In particular his ability as a swimmer resulting in the rescue of several seamen who fell overboard was transferred to Jack Aubrey
by Dudley Pope.
He took command of the frigate Indefatigable in 1796 and Forester places Hornblower on board, the only instance that I can recall of a fictional character serving on a real ship.
A biography by Stephen Taylor was published in 2013.