The term 外国 is deeply rooted in the Chinese worldview. Historically, China referred to itself as 中国 (Zhōngguó), the “Middle Kingdom,” implying it was the center of the civilized world. Consequently, all other nations were “outside countries.” While this “Sino-centric” view is a thing of the past, the language reflects this structure. Unlike the English word “foreign,” which can sometimes carry a sense of being strange or alien, 外国 is a much more neutral, geographical descriptor. It simply states that something or someone is not from China. It's a statement of fact, not a judgment. A useful comparison is to the term “international.” While 国际 (guójì) means “international” and implies cooperation and connection between nations, 外国 simply refers to the existence of nations outside of one's own. For a beginner, understanding this distinction helps clarify why 外国 is used to describe a “foreign movie,” while you would use 国际 for “international relations.”
外国 is an extremely common and versatile word used in all contexts, from casual chat to formal news reports.
The term is neutral in connotation and can be used in any situation without causing offense. It is the default, correct term to use.