No. Capacity is not enforced during combat; check it at the end.
After combat, choose and remove excess fighters or ground forces in space. Units on planets do not count against capacity.
LRR v2.0 (base game / Prophecy of Kings); specific card abilities may override the general rule.