As Solar10 stated, the only way to score damage hit% in a vehicle is to take out objects (or ships) with rockets or torpedos from a PT boat. Damage to targets caused in any other way scores to your regular hit%.
For attack, the damage must occur through use of bombs or rockets. Damage caused by straffing with cannons or machine guns scores to your regular hit%.
For bombers it's just as you would expect it to be although I'm not sure if damaging something with the machine guns/cannons scores at all. Maybe someone else knows.
[EDIT] BTW, dropping bombs or firing rockets at vehicles does NOT count toward either regular or damage hit%. It actually reduces your damage hit%. Only hitting objects counts.