Yes, in the people's republic of California, firearm ownership is legal, however, the nibbling self righteous socialist democrats who dominate the politics of this state are doing everything possible to gradually/incrementally erode these Constitutional rights.
The latest restrictions have to do with ammunition . . how much you can purchase at a time and how you purchase it . . . don't get me started or I'll end up going nuclear.
As for using a firearm against an intruder in your home, well, you better be able to prove that A) said intruder was wielding a deadly weapon of some sort. 2) as a last line of defense, you reacted in order to preserve your own or another member of the households' life.
You also should be prepared to spend a shitload of money on legal representation because the DA will most certainly be coming after your ass with the mindset that you shot at an unarmed exiting burglar.
Really, you have to read the letter of the law yourself and get a grasp on what your legal rights are . . . . ignorance is no defense.