The Cobra and the Viper are matched ships in dogfighting terms, they are equally manuverable and speedy. But the cobra has more internal space = bigger shield gen and more shield cells, battle won.
The Cobra has a good 30m/s of boost speed on the Viper and pitches 40% faster at half throttle (this decreases to about 10% faster at the ends of the throttle range, however). The Viper has noticeably better acceleration, better lateral/vertical and reverse thrust, better weapon convergence, and much smaller profile. These factor may roughly even out, but they are not necessarily equivalent. Certain situations and tactics can heavily favor one ship over the other.
If you think loading down your ship with shield cells is going to help your acceleration or somehow prevent the escape of a foe, you're almost as silly as one who thinks every fight must degenerate into a circling slug fest where all that matters is relative damage potential vs the damage the ship can sustain. Also, shield gens being equal, the Viper actually has stronger shields, and a Cobra with an A4 shield gen is not dramatically more well protected than a Viper with an A3.
It's very hard for either a Cobra or a Viper to corner the other. The Cobra has an edge here, because of it's higher mass and boost speed, but if the Viper pilot doesn't want to stick around it's very difficult to keep one from slipping out of range long enough to spool up the FSD.
I will say that I have prevailed more often than not when I was in a Viper and fighting equally skilled CMDRs in Cobra. Of course, I don't fight for the sake of fighting, and I stack the odds in my favor as much as possible before committing to any engagement.