Most countries have laws against discrimination in hiring and promotion on grounds like nationality, race, or religion, but the strength of enforcement varies far more than the text of the laws. In practice, foreigners tend to be treated most equally in large international companies with formal HR processes, and least equally in small firms where hiring runs on personal networks.
Some friction is legal and structural rather than discriminatory: employers may legitimately prefer candidates who need no sponsorship, and some public sector roles are lawfully reserved for citizens. The harder problems are subtle, such as being passed over for client facing roles or leadership due to accent or assumptions. Language ability and local experience often act as the real ceiling.
If you believe you face genuine discrimination, document specifics, use internal channels first, and learn which labour authority or equality body handles complaints in your country, since deadlines can be short. Unions and employee associations often help foreigners navigate this, and consultations are frequently free.