You have to be a legal immigrant with a permanent residence in the US first, but a non-citizen can enlist. You just wouldn't be able to hold position as a commissioned or warrant officer, and you wouldn't be able to hold a position with a security clearance.
The military can't help with the immigration or citizenship process, but HPD can.