The losses of planes flying over couple of trenches are enormous.
"Air attack" is the instance where the unit can actively attack the planes
You mistake two different things: a scenario setting vs. unit ability.
There's a setting called "Air units can be intercepted while flying", it's set on a scenario level, and it does literally what you wrote in the first quote, "the losses of planes flying over couple of trenches are enormous", because once set, the ground units fire at airplanes that are flying over them. It may lead to many AA attacks against flying-by planes and they soon end crippled before their flight ends.
I don't approve this setting, and it's truly illogical and bad.
Then there are two unit abilities that give to the non-AD, non-Flak ground units an AA ability and/or AD ability. These are the CAN Air Attack and the AD Support abilities. These make it that "the unit can actively attack the planes."
But this ability doesn't do anything to the planes flying over the ground units because this ability alone doesn't initiate the "losses of planes flying over couple of trenches" situation because there are no losses at all for the reason that there are no air attacks initiated against the flying-by planes.
What this ability however DOES, is that the said ground unit either can air attack (in case of CAN Air Attack ability), or fire an AD support (in case of the AD Support ability). Units with those abilities thus work like an AD/Flak units, and this may simulate a Flak/AD elements of the trench line, bunkers, etc.
I approve this ability, and it's truly logical and good.
Btw, Basekorps doesn't use the "Air units can be intercepted while flying" settings, I'm like 99,9% sure of that, because I use BK 99% of time. For clarity's sake: the setting that makes the ground units fire at airplanes that are flying over them, is not the same thing as ability of ground units to initiate AA/AD support against a planes parked above them.
So: the enormous losses of planes flying over trenches is due to faulty scenario design, not due to units' abilities.
edit:
PS. "Air attack" is the instance were the unit can actively attack the planes. Which is strange if the unit is not an AA unit.
Defending itself against air assault is another thing than (actively) attacking.
Air attack is not even a smart solution for bunkers.
Air attack truly is the instance where the unit can activelly attack the planes; the ability CAN Air Attack must do exactly that.
Then there's a passive air attack stat, and every unit with a non-zero air attack but without the CAN Air Attack ability (except for flaks, AD, and FTR, correct me if I'm wrong) does defend itself from the air assault.
Thus the units with CAN Air attack can defend themselves against air attack (if their AA is above zero) and also initiate air attack, and they can simulate local AA defense, AD elements of infantry div., etc. I don't see anything wrong about that. There are such AA/AD elms pictured above, and I think that those MGs can not only defend against the air assault (bracketed AA stats), but also initiate flak fire; they CAN Air Attack.
Then there are units like StuG40 that have the passive air attack (shown in-game with a bracketed AA stat), and those can only defend against an air assault. It is logical that they cannot initiate air attack (they CANNOT Air Attack), because they don't simulate local defense, but are e.g. self-propelled ATY.
My issue with these units is that their AA stats are so low that they cannot really harm the planes and so their AA fire just wastes the ammo.
Speaking of the third issue, there can be a "smarter" solution to AA defense than the CAN Air Attack and/or AD Support abilities, one such a fix is a high air defense stats. But this may lead to balance issues, and we may end with ground units that are impervious to air assaults. Which may or may not be bad from both realism point of view (realism be damned) and gameplay point of view.
We may of course argue about why it's fine for me to have an Entrenched Infantry unit with a CAN Air Attack and not a StuG unit with the same ability (in both cases this ability tries to simulate the same thing, the AA capability of the real-life counterpart, so why not give it to both), and we may also argue about the values (because in an extreme case of a CAN Air Attack unit with an AA stat of 0, there can be 200 of them on battlefield, yet they'd never harm any plane), but this is about an efile finetuning, not about the whole concept of CAN Air Attack / AD Support.
final edit:
Currently in the game a plane flying over an entranchment is tread as one attacking it. Which is totally wrong
Yes, this is totally wrong. In fact it's so wrong that it deserves a mention.
In this game a plane flying over an entrenchment suffers no harm at all most of the times, because most of the times it's not tread like it is attacking the ground unit. This is as simple as that, unless some change that I'm unawared of happened in the past weeks. Which is possible.
Noteworthy thing about the "plane flying over an entrenchment is tread as one attacking it" situation is that this happens only when the "Air units can be intercepted while flying" scenario settings is checked. (I'm not sure if this can be done on efile level, but it surely can be overwritten on a scenario level.)
I know this because I use the one efile you wrote about (Basekorps), and I don't encounter this issue while playtesting my scenarios. Why I don't encounter it? Because even if (and only if) Brian set Basekorps to use this setting, it still has no bearing on the game as a whole, not even in the very scenarios made for Basekorps... as long as the "Air units can be intercepted while flying" isn't checked in scenario.
Now, maybe Brian set BK to use the setting (if that can even be done... and once again: I'm not sure if it's possible, and I don't care as long as I can overwrite it while designing the scenario), or maybe he inherited this setting with the scenarios that were already set to the "Air units can be intercepted while flying" and which he used for BK. In which case I'd argue to change it, because this setting is illogical, bad, and leads to an enormous losses of flying-by planes.
tldr: Open General doesn't use the "Air units can be intercepted while flying" setting by default. Most of the efiles (at least the old ones) don't use it either, because they were designed before this setting was created (some of the CCs are from early 2000's and they were in fact made for the predecessor game), and if any efile uses this setting, than it's the efile keeper's fault (unless we think about some unorthodox/obscure reasons why this is used, e.g. Prehistoric General or Spacecraft Tycoon efiles), and even in such a case it can be overwritten on scenario level.