Exactly. One deducts the taxes paid in Country A from the due taxes in Country B. The reminder is the tax bill. Problem is that the Thai tax system has a relatively low tax threshold versus "The West", and you quickly hit the highest tax bracket.
Thai Tax Calculation
I am effectively retired here, though I draw no pensions as yet. The below is the result of THB 83,000 per month (~ 1mm p.a.), spouse does not work, one child in education, no other deductions at all.
I would have to cough up THB 64,000 i.e. 6.4% in income tax before deducting taxes already paid in Country A.
I assume you have to be working in Thailand to contribute to RMF, SSF & ESG, even though they want to tax as income monies that may not be income?