In the U.S. "alien" used to be the official legal term for non-citizens. However, this is changing. The most important residence document (green card) used to be officially titled Resident Alien Card, but is now changed to Permanent Resident Card. Government bureaucracy is vast, so I'm sure the change some forms still carry the "alien" terminology.
This change implies the term is somehow inappropriate, although I don't see it as offensive.
Most dictionaries put the synonym "foreign" before "extraterrestrial". The latter are a more interesting subject of popular culture (e.g. Hollywood movies), that's why some non-native speakers may get an impression that it is the more common meaning of the word.