Employers are not obligated to contribute to 401K. However, if they decide to contribute, percentage contribution has to be same for all employees having similar work experience. There cannot be any discrimination for H1B's.
Penalty for 401K withdraw is 10% + Tax. However if you leave US in 2009 and take out (say $25,000) in 2010 and you do not earn any income in 2010 in US, then you pay a penalty of 10% + tax on $25K. Since tax slab varies by income, its quite possible that you may not even pay any tax.
Many temporary workers who come to US to work opt to take 401K from their employer if its offered. Say if an employer matches 100% for first 6% of your contribution, then in literal sense, if you contribute $500 every month, your employer also contribute $500 every month. (Which is actually doubling your money). Now if in any year you do not earn any income in US, then take out the money out of your 401K upto the minimum taxable slab and you just pay 10% penalty. OR wait until 59.5 years of age. (Remember that you can only take out that money which has been vested. Generally after 3-5 years of contributing, you are fully vested on what you deposited and what your employer deposited).
After you leave your employment where you had 401k with you employer, you can either keep the money in the same 401K plan or you can roll over to a IRA which is owned and managed by you and not your employer.
All in all, 401K is not mandatory for any employer to offer. Its a benefit given to employees. Some do and some dont. Small consulting companies may not. Big corporations may.
Thanks.
------------------------------------
I can be wrong. Above facts can be incorrect. Please do your own research or seek legal advice or contact your tax consultant. Please do not rely on the above. I am not certified to give financial or legal advice.