http://www.atf.gov/firearms/faq/nonimmigrant-aliens.html#what-formImmigrant aliens, that is those aliens legally in the country intendint to reside permanently and/or become citizens can pass a NICS check.
Non-resident aliens who are here legally may possess guns only under some narrowly defined conditions.
A few excerpts and examples from the ATF FAQ on the subject:
Q: I have a “green card” and have lived in Texas for several years. Am I prohibited from purchasing firearms and ammunition from an FFL in Texas?
As long as you are not otherwise prohibited from purchasing or possessing firearms and ammunition (for example, a felon), Federal law does not prohibit you from purchasing or possessing firearms or ammunition. However, you will need to put your alien number or admission number on the ATF Form 4473 (5300.9) and provide the FFL with documentation establishing you have resided in Texas for more than 90 consecutive days preceding the transaction. Moreover, you must make sure there are no State or local restrictions on such a purchase.
Q: I am a nonimmigrant alien. I purchased a firearm in Maine in early 1998 after providing the Federal firearms dealer with documentation showing I had resided in the State for more than 90 days. I was told that this transaction was legal then. Am I entitled to keep that firearm and any ammunition I have on hand? Is there a “grandfather” clause that would protect me from criminal liability?
Since October 21, 1998, when the Gun Control Act was amended to make nonimmigrant aliens a new category of prohibited persons, nonimmigrant aliens generally have not been able to possess firearms and ammunition in the United States. The law does not contain a “grandfather clause.” Therefore, unless you obtain a valid State hunting license or permit (or fall within one of the other exceptions), your possession of the firearm and ammunition is not legal.
Q: May nonimmigrant aliens legally in the United States purchase or possess firearms and ammunition while in the United States?
Nonimmigrant aliens generally are prohibited from possessing or receiving (purchasing) firearms and ammunition in the United States.
There are exceptions to this general prohibition. The exceptions are as follows:
nonimmigrant aliens who possess a valid (unexpired) hunting license or permit lawfully issued by a State in the United States;
nonimmigrant aliens entering the United States to participate in a competitive target shooting event or to display firearms at a sports or hunting trade show sponsored by a national, State, or local firearms trade organization devoted to the collection, competitive use or other sporting use of firearms;
certain diplomats, if the firearms are for official duties;
officials of foreign governments, if the firearms are for official duties, or distinguished foreign visitors so designated by the U.S. State Department;
foreign law enforcement officers of friendly foreign governments entering the United States on official law enforcement business; and
persons who have received a waiver from the prohibition from the U.S. Attorney General.
Significantly, even if a nonimmigrant alien falls within one of these exceptions, the nonimmigrant alien cannot purchase a firearm from a Federal firearms licensee (FFL) unless he or she (1) has an alien number or admission number from the Department of Homeland Security (formerly the Immigration and Naturalization Service) and (2) can provide the FFL with documentation showing that he or she has resided in a State within the United States for 90 consecutive days immediately prior to the firearms transaction.
Q: I am a nonimmigrant alien from Canada and am planning to reside in Florida for 6 months. Do I need an alien number or admission number if I plan to buy a gun after living in Florida for 90 days? If so, how do I get such a number?
All non-U.S. citizens need an alien number or admission number to purchase a firearm from a Federal firearms licensee (FFL). The FFL will not complete the sale if you do not have such a number. This is the case even if you have a State permit that ATF has determined qualifies as a “NICS alternative” and therefore do not need to have a National Instant Criminal Background Check System check. Most nonimmigrant aliens will automatically receive an admission number when they enter the United States. However, Canadians will not automatically receive this number and therefore should specifically ask for this number when they enter the United States. These numbers only can be issued at a port of entry, so it is important that you request the number when you enter the United States. Please note, most nonimmigrant aliens will not receive alien numbers.