Even though it may not be u.s. source income; since h4 worker is physically present in USA they would have to show any income from worldwide sources on their US tax return.
Above answer is from tax point of view; since residency is defined differently then from an immigration point of view.
Person would have to get an ITIN number and ITIN numbers are not for work purposes but tax purposes. Therefore, whether it is allowed or not from an immigration point of view; there would be a papertrail that person is earning money subject to tax.