I can tell all of you that from my personal experience, it could be done.
I set foot in the US with a F-1 visa for a 4-year degree, got all my licenses in 2.5 years and worked as a pilot and an instructor for the 1.5 years, all while I was getting my degree.
I was gonna apply for OPT, and I was even offered a H-1 visa sponsorship by my employer before my F-1 expired. And I am not the only one without a green card from my university who got job offers, from different employers.
I didn't apply for OPT, nor did I get the sponsorship, because I took a gamble for, IMHO, a better job flying back home. Luckily, I got the job, so it worked out, but even if I didn't, there are other opportunities around the world.
Those 4 or 5 years of experiences will allow you to get a job, possibly jet, somewhere else in the world. It might not be the best flying job, but at least you'll be flying.
A few examples:
- Qatar Airways cadets/second officer (wide-bodies... and no, you don't need Qatar residency)
- Virgin Nigeria (737s)
- Winair in Sint Maarten (do a DH-6 course in Flight Safety International in Toronto and you pretty much have a job guaranteed)
- etc...
Aviation is all about who you know, and 4 years is a long time to build connections for future use, you might as well end up with a job in the US, as a few other posters have pointed out and/or personally done.
Of course, flight training in the US is cheaper than anywhere else in the world.