Basically no foreign tourists are allowed into Thailand at present.
Only limited categories of people (listed below) are allowed to enter. https://www.thaiembassy.com/travel/can-you-enter-thailand-now-during-the-covid-19-crisis.php
I don't think there are restrictions on leaving but you would get a temperature check at airport and prevented from flying if it indicates you might be covid positive.
hh