This can vary depending on your country of origin. It depends on the agreements with the country of origin and Thailand. The best thing to do is to check with your tax and pension experts in your country of origin to avoid any complications.