I believe it depends on the actual agreement between Thailand and the repatriating country. Previously Swedes who were transferred back home still had to serve the sentence they were given in Thailand in full, but this was changed a few years ago where Sweden now have the right to change the sentence to Swedish standards.