Yes, an illegal immigrant can potentially obtain a green card through marriage to a U.S. citizen. However, this will generally involve leaving the U.S. to process a visa abroad and possibly face penalties for their illegal stay. It’s advisable to consult with an immigration attorney in such situations.