Buying a house in Thailand
A non-Thai citizen can indeed buy a house in Thailand and have their ownership properly recognized and registered by local authorities, but since Thai land law prevents foreigners from owning land, foreign buyers must make special arrangements for the land the house sits on.
Ownership in a company
A company incorporated in Thailand is of course a Thai "juristic entity" with the lawful right to own land. Not less than 51% of the shares and 51% of shareholders must be Thai, but with specific Articles of Incoporation and weighted-voting rights, a foreign person can have absolute control of the company.
It is absolutely recommended to employ a Thai lawyer to deal with the Department of Business and the Land Department in order to establish such a company and confirm its ownership of land. Thereafter, the services of a Thai accountant are required to fulfill yearly paperwork obligations.
Alternative ways to secure land are land-leasing and usufruct-contracts
, both of which cover one's life-time, or 30 years - whichever is longest.