They do pay taxes while they are working under the visa program: https://www.irs.gov/individuals/taxation-of-alien-individuals-by-immigration-status-h-1b#%3A%7E%3Atext=If+the+H-1B+alien%2Cunder+an+income+tax+treaty.
They do pay taxes while they are working under the visa program: https://www.irs.gov/individuals/taxation-of-alien-individuals-by-immigration-status-h-1b#%3A%7E%3Atext=If+the+H-1B+alien%2Cunder+an+income+tax+treaty.