Sure, a company could not like you doing that and find a reason to fire you, but they have no valid legal recourse and you may even be able to sue them for wrongful termination.
We are one of the only states that prevents employers from having ownership of your brain on personal time.
Corpos have tried to claim ownership of things I did in my personal time, multiple times. I just show them this law and they back down immediately.
Having rights to my own brain is a big reason I live in California, cost of living be damned.
https://california.public.law/codes/labor_code_section_2870
IANAL, but know your rights!