There doesn't seem to have been an attempt to tie the ship itself with the loco, I'm not aware of any particular naming ceremonies with the ship's company present. You would expect ship badges on the loco bodyside if this happened.
There was a long tradition at Laira (and jobs on the railway in Plymouth generally) of sailors in mid life coming to the end of their time in the Royal Navy, often by then actually living in Plymouth with their family, and getting rail jobs. Those from the engine room were particularly attractive to diesel loco maintenance work, espacially at the start of dieselisation coming from diesels on ships (even the biggest ones with steam turbine propulsion would have large diesel generators for auxiliaries) when the railway experience was not there. They also commonly later went on to other management jobs across the Western Region. I bet it was an ex-Navy man who came up with the idea and also the name list.
The first three Swindon Warships were named after the BR Chairman of the time, and two battleships, but thereafter the names were chosen quite widely, and allocated alphabetically up to D865. When a final five additional locos were ordered it was a harder, but not impossible, task to find names starting with Z that followed on from Zealous. I bet someone pored over old Navy lists to do so.
D812 Royal Navy Reserve was originally to be named Despatch, but was just being completed when one was required for an alternative name. That one did get a naming ceremony.