The short answer is yes, if the gun is unloaded.
However, the long answer is that the laws in California are very complicated and one could easily find themselves accidentally committing felonies if they are not well versed in the laws. Be sure to fully understand the laws before attempting to possess a firearm in California. Check out the California subsection. There are pamphlets there and people there who will help you understand the California laws, and point you in the right direction to the proper penal codes which you must read yourself if you want to understand the law.
AB-144 is a bill in the current legislative session, which, if passed, would ban even unloaded open carry of handguns.