Happens all the time. I personally work with 3 people on my team alone who have done it. I believe at Google a transfer between countries involves a new offer, based on local cost of living etc, and it is basically indexed against what you would be making with the same experience, perf, etc. in the new locale, and Google compensation is really good for the region. Only complications are with retirement funds (IRAs vs RRSPs), and tax filing. I believe Google provides the services of an accountant for a couple years after the transfer.
Last couple of years it feels like every week I see an email from somebody asking for advice etc. for relocation.
For two of my immediate coworkers/friends, both did it a bit after they had kids, and began to contemplate having kids in the American school system[s], and away from grandparents, etc.
It certainly makes it easier transferring within the same company. I think many Canadian SWEs coming back to work after being in SV would find the job market to be rather frustrating/annoying if they had to hunt for a new job. Transferring within the same company takes the edge off.