Thanks for asking this question, as it's something I wondered about. Rafting seems fairly rare in Washington State, where I sail most, except on very busy weekends, then you are usually warned when you dock. At least that's been my experience.
This spring we sailed up the west coast of Vancouver Island. When we got in to Tofino, cold, wet and tired, the harbor master said "You can raft up to that really nice, fancy wooden sailboat with no one on board" (*Paraphrased to add color*) but didn't offer to help. Without experience rafting, or knowing the educate, or the local customs, we where happy to find another small spot on the end of a dock we could tie up to.
Now that I have a *little* more experience, and know that it's customary in BC thanks to this thread, I won't freak out about it so much next time.