That's what Amazon is doing with their Vancouver office. Since getting enough hires into the US is too complicated, it's easier to open an office really close to Seattle and give those tax dollars to Canada instead of Uncle Sam.
Amazon's problem is completely different. The management disgraced the company and no self respecting American wants to work there. Some of their tech departments are 70% Indian. They want to hire people in American, but, surprise, America is full of those damn Americans, none of whom want to work there.
Plus they can pay people drastically less because the Canadian job market is a joke.
Sure, since it isn't going to an American anyway.
Hiring an immigrant vs offshoring has many more benefits. Tax dollars to start with, but immigrants also spend that money on food, housing, etc