It depends...
For straight up pure coding skills, generally no. But the problem is that there are various different ways to be a "bad programmer", depending on context. Some of these can be harder to be self-aware of.
STRAIGHT UP "PURE CODING" SKILLS
This is actually the toughest to be self-aware of. Most of us like to think that we have "l33t coding skillz" and we don't want to admit otherwise.
Admittedly this is a bit abstract, and the difference between this and some aspects of the following are a bit arbitrary. But bear with me.
POOR "CONTEXTUAL" SKILLS
Wayne M's answer is an example of what I'm going to try to explain here. Basically, I think a lot of people who are seen as "bad programmers" in a certain light are not necessarily outright bad programmers as much as they are tested in a situation which isn't conducive to them being seen as "good" and productive. And visa versa - some relatively average programmers, when working a certain flow which is just perfect for them, can be seen as quite good and productive. It's a sliding scale.
A huge complicating factor are the degrees of "supporting skills" that people have. For example, I've worked with some very good programmers - who were great coders when taken in a vacuum, but had atrocious writing/documentation skills. This didn't matter much in the small, close-knit Agile group on that job, but it would be a killer on a huge Waterfall project - one which is highly depending on them commenting and documenting their work thoroughly. They were simply the sort of people who seemed to be born without the part of the brain to explain things well in writing. So in one job they were the team rockstar. But in a documentation-heavy Waterfall job, they might have been seen as outright "bad programmers".
Another common example is GUI design, visual creativity and usability. Some people are just terrible at it, even though they are great programmers on the back end. The problem is, someone who creates a horrible-looking UI isn't necessarily a "bad programmer" (ie. They might be great for a more backend and business logic job), but they can often come across this way when "tested" by an environment which is heavy on a certain skill application context.
CONCLUSION
I think it's hard to be aware of how good or bad you are on a very base, "pure coding skills" level, but easier to be aware of shortcomings in highly contextualized "supporting" and "soft" skills. The problem is that one can mask the other, and very few programmers are great all-round rockstars for every possible context and type of job.
Finally (this is similar to what Wayne M's answer talks about): One thing I admittedly have is a motivation problem. Basically I love programming on a very pure, abstract level, but then when I have to work for someone else and grind away at nitty gritty details of some boring business system I have no personal interest in, I easily lose patience and focus. Motivation plummets, work suffers. I'm sure it made me look like a "bad programmer" in the past, but it had nothing to do with straight up coding skills. Having intrinsic motivation is very important to some people, and others can just work on whatever random project you put them on. It doesn't necessarily reflect coding skills per se.