I tried to join all four forces in that order: Air, Navy, Army, Marines for whatever position in whatever country (read Iraq), they could offer in order to stay in the US and gain a green card.
That was 3 years ago and I was there legally on a sudent visa: they all answered the same tune: you need to be a permanent resident to apply, period.
Still the same today: just check their web sites.
No need to dream about it anymore