My thoughts are different and dimming IMO is a voltage drop problem not likely related to something outside the home if the dimming occurs when something with a high inrush current kicks on. Your service should be sized to handle such loads without a drop.
Undersized wires overloaded circuit or most likely poor connection is what I would look at.
I would start with the panel and make sure all connections both power and neutral are tightened down. I know not why but have seen over time it doesn’t hurt to snug them down.
The fact it happened the same with the old and new AC would rule out a problem with the AC. Is the AC a 240v whole house central air system or just a window unit. Do all lights in the whole house dim or just ones on the same line as the AC.
We have a large window unit that cools the whole first floor and I ran a new line from the panel to the outlet for the AC with nothing else on it. You may need to do that if it is a window unit.