"Wish", used as a verb, means that one wants something to be true although one knows it is either impossible or unlikely. So it involves the use of the past subjunctive.
To make a wish about the present, use a past-tense verb, or "were" in the case of verb "be":
I wish I were a bird.
To make a wish about the future, use a past-tense modal verb, frequently "would", or a past-tense verb if it is difficult to tell future from present:
She wished that Ben would come home soon.
I wish that I could go there with you tomorrow.
I wish I didn't have to go to work today.
To make a wish about the past, use a past-perfect verb, or a past-tense modal verb plus a present-perfect verb form:
Sometimes I wish I had never been born.
I wish I had been able to drive a car then.
Notice that your sentence "I wish I could have driven a car then" does not mean what you want to say when you correct the sentence "I wish I could drive a car then", and doesn't sound right to me.
If the "ability" is involved, we have to say "I wish I had been able to drive car then" (I wasn't able to drive a car then). If I regret not having driven a car at that time, we have to say "I wish I had driven a car then" (I didn't drive a car then). If we want to say something about the decision of going somewhere by train, by air or on foot instead of driving a car, we can say "I could have driven a car then" (but I chose not to drive a car then). If I regret that decision, we can say "I shouldn't have driven a car then" (I did drive a car then), "I should have gone there on foot; I could have chosen not to drive a car" (I did drive a car then). It all depends on what we intend to convey.