The US military already takes foreigners into other ranks as long as they have a green card. Citizens of most countries can join unless you happen to be from Iran, China, Russia, North Korea etc, in which case you will be deemed too much of a security risk to be allowed through the gate.
You'll never be commissioned until you get US citizenship.
A friend's father joined the US Navy that way, and declined a commission because he didn't want to give up Thai citizenship which was a big part of his retirement plan. A friend of a friend, also from Thailand, is now in the US Army. I think he joined under the MAVNI programme, which means that he didn't even have a green card, just a valid tourist visa. Luckily for him, the Pentagon still views Thai language as a key strategic skill that should be maintained, making him eligible to join under MAVNI regulations.
Trump has since cancelled MAVNI.