Since at least the Civil War; something like 20-25% of the Union Army was foreign born non-citizens. From around 1900-the 1970's the Navy had a program that allowed personnel from the Philippines to enlist and perform a variety of jobs.
In general they can't; if they have a particular set of skills etc. they can get a Limited Access Authorization which only can be used for regular SECRET and below. The military uses this for non-citizen enlistees who need access to CONFIDENTIAL & SECRET information but some operational information is still restricted.