There are only 2 units in the game that automatically die in combat alone vs enemy forces.
Transports will die automatically if attacked and there are no units capable of mounting a defense. IE, a sub attacks a lone transport adjacent to an airbase. Fighters/Tac from that air base scramble but are incapable of hitting the sub so the transport dies automatically.
AA guns can be taken as casualties if present with friendly forces. Alone they die without accomplishing anything except maybe stopping a blitz. Keep in mind that though they don’t have a combat value, they still get their aa shots against any attacking air units as this takes place prior to the first round of combat.
And of course land units on transports don’t get to participate in combat if the transports they’re on are attacked. Same goes with allied fighters on an attacking carrier, in which case they’re just considered cargo. Although allied air on carriers can still participate in defending against attacks.
Every other unit in the game can defend or attack in various combinations of air, ground, naval to your heart’s content. Pair some amphibious assaults with capital ship bombardment and air for the trifecta. :-D
Each player gets to choose their own casualties as well. So in the scenario you presented, the defender would be wise to keep his expensive and heavy hitting fighters/tacticals for last and lose cheaper ground units and/or aa guns first. As long as it’s an attack and not a bombing raid, all units in the terr will defend against all attacking units simultaneously.