It can be done and a lot of people are doing it, especially in cities like Goa. However most often than not, it is illegal and in case Indian government takes action, you can loose your property.
So it would be a good idea if you talk to a lawyer here or with your embassy to learn more about it, before making an investment.