Here's the hard truth: in Battlefield 3, there's no reliable way to block or counter a knife once an enemy gets the drop on you. The melee takedown is essentially instant, so your best defense is simply never letting anyone get close enough to try.
Stay aware of your surroundings, keep checking your six, and avoid getting caught alone in tight corridors. A little situational awareness goes a long way toward keeping you out of knife range in the first place.