In the U.S., a legal worker, by law, is protected with 3 months trial period, during which the employer can not fire you for any reason, even for H1-B worker. If you are illegal worker, you still can fight for the right, but the trade off is your status will in question.