The honest answer is that it spans the full spectrum depending on the country. At one end, plenty of countries allow non-citizens to buy freehold property with no restrictions at all. In the middle, many impose conditions: foreigner-designated zones or buildings, minimum purchase prices, limits on agricultural or border land, or a government approval step and extra stamp duty for foreign buyers. At the strict end, some countries prohibit foreign land ownership entirely, offering only long-term leases or condominium units within a foreign ownership quota.
Where direct ownership is blocked, you will hear about workarounds like holding companies or a local partner or spouse holding title. Treat these with extreme caution; some are legitimate and regulated, others are grey-area arrangements that leave you with no enforceable rights if the relationship sours.
So before any money moves, hire an independent local property lawyer to confirm what someone of your nationality and visa status can legally own, and verify everything against official government guidance rather than agent assurances.