This is one of those questions with a completely different answer per country, so treat any general claim with suspicion. The global spectrum runs roughly like this: some countries let foreigners buy essentially anything on the same terms as citizens; many allow apartments and buildings but restrict land, agricultural property, or border and coastal zones; some permit ownership only through long leases, local companies, or with government approval; and a few bar foreign ownership almost entirely.
Common conditional patterns include minimum investment thresholds, permits required for non-resident buyers, reciprocity rules tied to your nationality, and ownership caps within a single building or district. Some countries also link property purchase to residency programs, which changes the calculus entirely.
Before falling for a listing, confirm three things from official sources or an independent local property lawyer: what exactly your nationality and residence status permit, which ownership form you would actually hold, and whether approval steps add months. The land registry and government housing ministry pages are the right starting points.