Totally depends on the situation...
If you have a 100+ class size at a university with a crappy teacher, or a 25 or so class at a CC with a good teacher, then by all means go for the CC.
Talk to students that have taken the class at the specific CC and university you are talking about.
If the class size is smaller and the teacher is good at a CC, you might have a better experience there. I took Ochem at my school, the classes were huge and the teacher sucked. It was offered at the CC, with one of the Chem PhD students from the University (who also taught our labs at the University, and was an awesome teacher) teaching it. If I had known that ahead of time, I would have taken it at the CC, saved some money, and probably learned more to boot. I did okay in Ochems, an A and a B, but man did the big class size suck. And the teacher was awful.
But check with the school you want to apply to to be sure that they accept credit from CCs.