Taking CC classes for GE?

Can you take classes during the summer at a community college in order to fulfill General Education requirements?

I’m a HS senior who is applying to UC campuses as a freshmen. I heard you can take CC classes during the summer in order to fulfill GE’s, but I’m not sure. Say if I took an English class at a CC during the summer, could I then use that credit a UC? If so, how would I go about registering for the class? Does this question vary at different campuses?

Thanks