In the current security climate it is highly unlikely any cruise line will allow visitors to board the ship. Your best bet is for your friends to leave the ship and for you to take them to lunch.
When we were in Madeira on the QE2 pre 9/11 it was not difficult to organise but since then it has always been no until 2 years ago in Cannes I asked not long after we joined the ship and got a yes but needed to supply the individuals full and and postal address; their age and passport number and was issued with a seapass. We had to go off the ship to meet them then bring them on with their passport in hand and the seapass I was given and we had a very enjoyable day. During our lunch the chief security officer paid a visit and rechecked the details but no problem so whilst it is unlikely your friends would have to ask the purser very early into the cruise if it was possible and take it from there.
I have cruised several time from Dover and the rule was that no guests were allowed on board for security reasons.
What cruise line? Some allow day visitors during swapover day - Travel agents and the like, and some like RCI use this opportunity to take interested clients who have never cruised with them aboard as a tempter. As mentioned you need to supply passport info etc. Try asking the cruise line and pretend to be interested in buying a cruise!
How things have changed! I remember the times when any ships in the same port welcomed you aboard to look around & have lunch if you wished. All you needed, was to say I'm off the Arcadia, Canberra, or whatever & you up the gangway to look around the oppositions ship as a potential customer. No ID was ever asked for as we never carried any, no seapass/cruise cards in those days, no method of checking you on & off cruise ships, just trust in the fact that we were not all the terrorists we are now purported to be!
Those were the days. I sailed from Southampton on board the P&O "Canton" in 1958 and not only did guests visit the ship for afternoon tea but a band played at the sailing time. Shortly before sailing the famous call came over the lodspeaker system "All ashore that's going ashore"!Mind you, in those days they were not cruises but liners mainly taking people back to their jobs overseas often for tours of three years or more without home leave so there was many a tearful farewell. There wasn't the security in those days that we have today but when you reached your cabin you found a complete passenger list including names, addresses and name of employers. I wonder if cruise passengers would appreciate that today!!