Can I retake a Dual Enrollment course at UCs?

I’m a senior in high school and currently I’m taking two dual enrollment classes that give me college credit.
I took spanish 101 & algebra 105 and am taking 102 spanish & 110 precalculus now.
I got a B for spanish 101 and I might get a C in 102… ( no troubles with math tho)
Because these grades are going to be in my college transcript, obviously they will lower my GPA. (I’m planning to go to grad school)
can I retake them or are those grades with me forever? Can I retake that B to an A or there’s no way?
basically, can i retake a dual enrollment course?