@Ron *******
you use the immigration office that aligns with the most recent TM30 that was filed for you. So if you are staying in a province and a hotel or landlord files a TM30 for you, you can apply for extension at the immigration office in that province.
For example if you're staying in Bangkok but the Samut Prakan immigration office is much closer to you, you still cannot go there because you're not staying in that province.
But if you're traveling around Thailand and check-in to a hotel in Krabi that files a TM30 that they are legally required to file, you can go to Krabi immigration for your extension.
Also you cannot go to any immigration office. For example there are about 5 immigration offices in Bangkok, but each one has a specific purpose so you can't just pick any one to go to. You must go to the relevant one.
But in Phuket and Chiang Mai and other provinces there are multiple offices that would allow tourist 30 day extensions.