You could work for two employers when you are in the OPT as long as your work relates with your study. But for H1B, it would be very hard. You need to consult a lawyer. basically your H1B is always associate with one employer, which is also called your H1B sponsor.