A foreign worker in the U.S. must have employment authorization in order to work. Typically, this is obtained through the H1B visa process. An employer obtains a prevailing wage determinatioin and LCA through the Department of Labor. An I-129 application is then filed with USCIS and the employer must show that the employee has the proper qualifications for the job.
Individuals working on an H1B sometimes ask if they can work for a separate employer on the side or as an independent contractor. This video explains how such an employee can work for two employers at the same time – namely, by obtaining separate H1B visas from both employers. Absent that, the employee is typically limited to working for the single, sponsoring attorney.