In principle, most countries require equal pay for equal work, and many work visas actually impose a minimum salary at or above the local market rate precisely to stop undercutting. So for sponsored professional roles, foreigners are often paid at market level or slightly above, especially where the skill is scarce.
Reality is messier at the edges. Foreigners can earn less in practice when they lack local credentials, negotiate weakly because the visa depends on the job, or work in sectors with weak enforcement; lower wage migrant work is where underpayment problems concentrate. Conversely, expat packages with housing and schooling allowances still exist in some industries and locations, though they are rarer than they once were.
The practical move is to research local salary bands through professional networks and published surveys before negotiating, and to remember that visa dependence is not a reason to accept below market pay. Know the minimum salary rules attached to your permit; they are a useful negotiating floor.