This is one of those areas where countries differ dramatically, so never assume. Many countries, including most of Europe, North America, and places like the UK and Australia (with approval requirements for some buyer categories), let foreigners own property outright with full title. Others restrict ownership to certain zones, cap foreign ownership within a building, bar foreigners from owning land while allowing apartments or buildings, or require government approval for each purchase.
A further group effectively requires structures like long leases, local nominee arrangements, or a locally registered company. Be very careful with informal nominee setups where a local holds title on your behalf; in some countries these are legally shaky and people have lost everything.
Before falling in love with a property, get the ownership rules for your nationality and residency status confirmed by an independent local property lawyer, not the selling agent. Also check whether ownership rights change if your visa status changes, and whether extra taxes or stamp duties apply specifically to foreign buyers.