No, this is one of the most persistent myths out there. Of course everyone has seen "African Queen" where the captain marries Humphrey Bogart and Katharine Hepburn. But it's really not true.
If you have seen a wedding on a ship, then one of two things was true; 1. the captain was also an ordained minister or justice of the peace or 2. somebody else was performing the ceremony.
Also notice that you have to get a valid marriage liscence on dry land before getting married nowadays.
edit; many cruise lines will make the arrangements for a legal wedding at sea. But just being the captain of a cruise liner does not entitle you to perform marriages.
www.straightdope.com