Will the villagers move out of their homes at my friends island, if I invite them to live with me on my island?
No. You can only invite a resident from a friend's island if that resident is already packing to move out AND you have a vacancy. You can have someone in the process of moving out, that counts as a vacancy.
Is it even possible to invite them by visiting a friend on their island?
Yes! Buy only if the friend has already given them leave to...er...leave.
Conditions for inviting a friend's villagers
You: Have a vacancy or a resident packed up and moving out.
If you are full, the resident will try calling Resident Services and tell you that there's no room.
Friend: Must have the resident moving out.
You can only attempt to invite residents that are moving out. There's never a dialog option to ask villagers in a regular state or who are moving in to move to your island. You cannot steal your friend's residents.
The timing can be tricky. Your vacancy needs to line up with a friend's resident moving out.
Tom Nook seems to fill vacancies after a day of a house plot being empty. If this happens, you get no say in who arrives. Which means you can't safely leave a house empty until your choice is ready to move, even if you and a friend are in agreement.
Campsite visitors are the only (current) way* to attempt to get a new resident without having a vacancy. You have no control over when campsite visitors show up (game text implies a higher rating means more visitors, but I haven't noticed much difference between 2 and 5 stars). Pressing a campsite visitor to move will trigger a Resident Services call, but this time a random resident will be selected as "considering" moving out. You can choose to accept the choice or not.
Weirdly, if you decline, it appears to trigger another resident to "think" about moving. Later that same day (or possibly the next) you will be able to see a resident with thought bubbles, asking you if they should move or stay. Which is to say, if you have a campsite visitor, you can convince them to call RS and then tell them no in order to have a good chance to get a vacancy within 2 days.
If you have a friend's cooperation, you can try to line things up. Unfortunately, the timing and randomness involved makes it very unlikely to get your choice in even a small number of attempts.
*Except for having a character's amiibo.