Yes, you can marry your Thai girlfriend in the UK on a tourist visa. As long as you follow the correct procedures and get permission to marry.
What’s the procedure?
Contact the area registrar, they will then apply to the home office for special permission to marry. This can take up to 45 days to get permission to marry whilst on a visit visa.
Can she switch to a spouse visa once we are married?
No, the applicant must return to her home country and apply to join family members in the UK.
What documents must I submit for a tourist visa?
How does the UK marriage visitors visa work?