You CAN'T apply to another country's embassy. You need to apply to the one in the country YOU ARE. And you'll need to check if that embassy accepts tourists or foreigners. The best would be to apply in your country when you're there. Otherwise, choose the embassy where you stay for quite some time (you're not supposed to apply and leave before confirmation).
The ask:thailand community, consisting of multiple Q/A groups with over 100,000 members, powers this platform. It is not an official government resource. Our members actively contribute to this resource, and while we strive for accuracy, we cannot guarantee its complete reliability. Assistance to travelers is provided as a community service.