I think you should be able to do it after getting your H1B visa. I have not seen someone in OPT status do it, however I have seen people in H1B status do it. You can start an LLC and then start making money. You need to report that money in your IRS tax filing, make sure you report that and pay taxes on the income. Later if there is an audit or any questions from IRS, be prepared to show all the receipts and anything and everything related to this income.
However I would talk to a CPA and an Attorney first. You can even do it without an LLC, however LLC will protect if there is law suit or any other legal issue because your liability is limited. I don't know much about the laws in California, typically California laws are forward thinking compared to most other states, but that is a generalization. I don't know how that would apply to your specific scenario.
I would consult with a CPA and an Attorney, also ask this question in immigration forums.
Please don't take my advice as such, I am neither a CPA nor an Attorney, talk to a CPA and an Attorney and then do it.
How about your employer? Will your employer be okay with it? You won't make a whole lot of money driving for Uber, you might probably get more by spending more time at your employer, at a young age working hard, learning the business, showing accomplishments, becoming an expert in your chosen discipline, solving problems in a pro-active manner, building great relationships, helping people in your office will probably fetch you more in the long run than driving for Uber?? Something to think through.
Also check out my book Puga Sankara's Supply Chain Blog - that is a must read before spending Hundreds & Thousands of $$$ on your MBA or Masters Degree to get the best ROI or before starting your Entrepreneurial journey.