Can homosexual couples who are in Thailand get married and can one apply for a marriage visa on this basis?
No, legally, two people of the same gender cannot marry in Thailand. And also legal marriage between transsexuals cannot be done under Thai Law. Note that since you cannot get married you cannot apply for a marriage visa either. If you are over the age of 50 then you can apply for a retirement visa, but no marriage visa.