Not sure about Thailand, but this is true for USA.
My colleague's wife is on H4 (dependant) visa and prior to coming to USA, she had a job in India. We talked to a lawyer and then with USCIS and both of them confirmed that it is not a possibility that she can work remote here in USA on H4 even though she gets paid in India.