Yes in many markets, but expect tougher terms than locals get. Banks commonly ask non-residents for larger down payments, often somewhere in the range of a third to half of the purchase price, and may price the loan slightly higher. Some countries' banks lend readily to foreigners; in others, mortgages for non-residents are rare and cash purchases dominate.
The document pack is fairly predictable: passport and visa or residency status, proof of income such as employment contracts, payslips and several years of tax returns, bank statements, existing debt overview, and sometimes a local tax number and bank account opened in advance. Income in a different currency than the loan triggers extra scrutiny, and some jurisdictions restrict such lending outright.
Rates and ratios shift constantly, so ask two or three banks plus an independent mortgage broker who handles foreign buyers for current terms. Get pre-approval before house hunting, and factor exchange-rate movement into affordability if your income and the mortgage sit in different currencies.