Technologically it became not only possible, but easy in the time of cannon ships - when they started to heat the cannon balls to lit the enemy ships. If they could keep hot cannon balls, they could keep the hot stones without litting up the own ship. or to use these balls. Relatively closed space and pouring the water on these stones make no problem by itself. In travels by foot a tent was used, on the ship a sail could be used. Not a problem.
So, Russian, Norwegian and Swedish (Danish?) war ships could make a sauna, they loved it, it was a natural part of life for them, and every time when they had enough wood, surely, they did it.
About when that possibility was realized. When I have read the description of the travel of Bellisgauzen and Lazarev in which they open Antarctida, banya ( = sauna with a bit vapour) was mentioned as a weekly (on Saturdays) washing for the command. And it was something absolutely natural, not special for that expedition. It was not thorougly described there, only something as "After banya, when the free shift was resting on the deck, checking and repairing their uniforms, ropes and spare sails...". It is 1819-1821 years. I don't have earlier references.
As for former times, when ships used cabotage courses, the sauna on board was simply useless and dangerous. Games with fire are dangerous on a wooden ship. Any ship owner could have such caprice, but if somebody had registered that?
As for Vikings, they could be the first in on board sauna use. Their travels in the open sea lasted for several days. They needed it and they could do it. But now mentions known to me.
Japanese and Chinese term in light variant was simply a large barrel of hot water. Absolutely no problems to use that on big enough boat, you should only have enough wood and an oven.