I think killing in self-defence is perfectly acceptable yet I strongly oppose the death penalty. Is this consistent?

Yes. To say it's okay to kill in self-defense usually means that it's okay to kill in response to an immediate threat to one's life or safety. We could add various qualifications, but on anything like this understanding, capital punishment isn't self-defense. The person executed almost never poses an immediate threat to anyone's life or safety.

Of course it's sometimes argued that capital punishment protects society in general from a more hypothetical threat of doubtful probability, but that's presumably not what you mean when you say you think killing in self-defense is acceptable. So there's a distinction and hence no problem of consistency.

Read another response by Allen Stairs
Read another response about Punishment