Yes, you can get a residence permit in Greece if you buy a house. However, the house you're going to buy should be €250,000 or €500,000 minimum (depending on the location) to be able to qualify for Greece residency. If the house you're buying costs less, you'll not be able to apply for Greece Golden Visa program.