This is a very tough question to answer because there are so many variables that go into the safety of food, both with the food, and with the person eating.
If you are concerned with eating street food in Thailand, I would recommend sticking with foods that are stir fried or dishes like soup noodles so that they are served hot and fresh. Also, try to eat at restaurant and foods stalls that are busy and have a high turnover rate of customers – this will typically mean the food is fresh and cared for.
Pre-made curries that you see sitting in glass cabinets on the side of the road might be the most risky as bacteria starts to form. Especially avoid shellfish at these types of stalls as they spoil the quickest.
What I can say is that in my opinion Thai street food, as long as you choose wisely, has quite high hygienic standards, and vendors typically serve fresh food. I’ve eaten and an uncountable amount of street food stalls in Bangkok and throughout Thailand and I haven’t really had any problems.
In the end I often hear about people getting sick eating at fancy restaurant just as much or more than at street food stalls. So it’s kind of an unpredictable thing, just use your judgement for each situation.