Yes in many countries, but expect tougher terms than locals get. Banks typically want foreign buyers to put down a larger deposit, often somewhere in the range of a quarter to half of the price, and some lend only to foreigners with local residency, a local income, or an established banking history in that country. Non-resident mortgages exist in a number of markets but at higher rates and with fewer lenders competing.
Documentation is fairly universal: passport and visa or residence permit, proof of income (salary slips, employment contract, or business accounts), tax returns, bank statements, existing debt details, and sometimes a credit history from your home country. Income earned in another currency can complicate approval, since lenders discount it for exchange-rate risk.
A mortgage broker experienced with foreign buyers is worth their fee in most markets, as they know which banks actually say yes. Compare the total cost including arrangement fees and mandatory insurance, and get a pre-approval before house hunting seriously. Rules differ by country, so verify locally.