@Roberto ********
Thailand's unimaginably stupid tax principle that only remittances are taxed, is what makes your transaction tax free (if you live in Thailand and if the applicable DTA appoints Thailand for this particular type of transaction). This doesn't take away that the transaction, if the DTA appoints Thailand, is subject to Thailand's tax laws. So the way you just put it, that Thailand has nothing to do or nothing to interfere about a transaction only because it was effected elsewhere, is untrue.
In countries without the said unimaginably stupid remittance principle (a group that Thailand is also joining by the way), you just owe tax over the profits (subject to DTA).