I don’t know about any other nations but for UK passports, you need to apply independent of the British Embassy. There is a process whereby you go to Trendy Building on Soi 13 in Bangkok.
Long time ago, I was on overstay (1 year), I applied, received and then went to the airport with my 20 000 bt and paid the fine. This was before the blacklisting that occurs now so I could return almost immediately.
It is only Thai Immigration that care about the overstay. It shouldn’t stop you applying for a new passport.