All Thai embassies and consulates now use the evisa system. You don’t physically go to them to apply (but you may be asked to attend after application) you do it online.
You must be in the country of the embassy or consulate you intend to use. Part of the application process will ask for proof that you are.
Once applied for you are meant to stay until approved. Some have managed to obtain visas after they have moved on elsewhere but there is a chance they could call you in for an interview - which obviously would be difficult to do if you’re not there, or if they see you’re no longer in the country could just outright reject the application.
There’s a new set of rules coming in to effect on Monday. We don’t know full details as yet but it appears that only 2 visa exempt entries will be allowed per year and extensions will be restricted.