A foreigner can get a Thai ID Card from the Thai authority
but it is a pink card which is different from Thai people. It will be stated in the pink card that the card is for the non-Thai citizen only.
Such foreigner has to get the consent from the head of the Thai family to have his name listed the House Certificate.
Then, the foreigner will have the right to get the yellow House Certificate and apply for the pink ID Card from the Thai authority.