Under the laws of all states in this country, an undocumented alien is allowed to buy real estate. There is nothing illegal about selling real property to one who is not legally in this country. The illegality stems from the person who does not have a proper visa or green card to be in the United States.I suggest as a safeguard that you consult with a real estate attorney further about the question that you are writing about.