The key, in our opinion is to make sure your dog is poorly house trained. A boat, though it is your home, is not a house. It is easy to clean off the deck or floors on a boat, and a well house trained dog will think he or she is being bad when they do their business on the boat. So before you leave to go cruising with your dog, section off an area of your home (preferably outside like a deck) for your dog to do their business. It might be awkward explaining to your house guests at the cocktail party why fluffy is crouched on the deck beside the smokers laying a loaf, but your maritime future will be bliss because of taking such measures.
We lived in a small apartment, and as we adopted Dex from the SPCA, we never got to fully house train him. So we would leave the deck door open so at least he would go outside and not on the carpet. In city life we were seen as lazy, however in sailing life we are the envy of our canine owning peers. Dexter stayed on the boat for three weeks, from Georgetown Bahamas, a week in Jamaica (quarantined on the boat) and then a rough ride across the Caribbean sea to Panama. He was happy just to be with us, and never made an issue about going to the bathroom. We have heard of horror stories about dogs holding it for 4 or 5 days, ouch. The only frustrating part was Dex would sometimes place his treats under the mast, so when it came time to reef at night we had a few unfortunate foot placements. We have a dust pan we flick it off with, and hose or bucket it down. Super easy, we just have to make sure he's strapped in when he goes offshore, "Dexter, four leg stance!!!"
Clearing in and out of countries was another question we frequently get. With the Bahamas, they want you to get a permit in advance. It took about 2 months and cost $10. We showed up, showed the form to customs and that was it, they didn't even check his rabies certificate. In Jamaica they told us he had to stay on the boat, even though the locals and some of the laid back government officials hinted we could take him over to an abandoned island at night as long as we were hush hush about it. We even heard from a local that he would take another cruisers dog over there for walks as those cruisers had stayed for 2 months. We decided that Dex could handle an extra week. In Panama, we provided a billion copies (actually 4) of his rabies and shots certificates, paid $15 and he was in. No fus made, we haven't yet had to get a vet certificate of health, no has anyone even looked at Dex other than seeing him tied to the cabin trunk as they board. Clearance so far has not been an issue at all for Dex.
Watch their water intake, it's hot down here
get a good collar and keep a boat hook handy for dog overboard drills
always put their life jacket on offshore
let them bark at other boats (it a security measure)
make sure they have things to entertain them (for Dexter it is something to chew on)
a glowing collar can be nice during the night when sailing
make sure your companion has a cool place to lay down
buy a bigger and faster dinghy, more options for walks and less claw marks on your legs
they sell dog food everywhere, just not the brand you want
BRING your dog, they are great on a boat