Yes. If you have an allied fighter on your carrier when you attack and take a hit on that carrier it still carries the allied fighter.
However, the fighter can not take off while the carrier is damaged. BBs and ACs repair after the politics phase. They can attack and defend while damaged
Additionally fighters cannot land on damaged carriers.
Precisely units (and facilities) are repaired during the Purchase and Repair Phase after the order of new units.
This is actually before “Declaring War”. Declaring War happens at the beginning of the Combat Move Phase.