Sure, but not if they wish to keep on operating (i.e. selling things, and manufacturing things as part of their business) legally in that country.
There are significant costs associated with something as visible as banning the sales of Apple devices. Governments are certainly capable of doing this, but the cost-benefit analysis does not necessarily add up.
The benefit of Telegram and Signal doing this over a company like Apple is that they don't own a significant part of the smartphone and computer (and associated services) markets. This gives Apple a lot more control and influence over people and consequently carry a lot more responsibility in what they do. If I notice Signal doing something I like, it's far easier to convert to a competitor than it is for the average user to switch away from the Apple ecosystem once you're in it.
Also unlike Telegram, Apple has significant local physical presence and employees that the government can go after.
What significant local physical presence does Apple have in Thailand? They're setting up a factory there, kicking that out would hurt Thailand way more than it would hurt Apple.
Having to comply with local laws and regulations is sort of accepted when operating a business in a particular country. How would it hurt Thailand significantly more than Apple if they're ejected for not complying with legal requirements? And frankly, it's sort of moot. Apple is more than happy to comply with national governments. Just look at them pulling communication apps whenever there's a protest in <insert country with autocratic government here>.