I know this is an old post, but I thought the information here is not sufficient.
I would say that there might be a connection between dirty power and your batteries, but I doubt it, and it's not for the reason you suggest.
Dirty power is not an engineering or electrical term but the phenomenon that you describe are real. You can generally separate out the influences that you have described as high frequency (spikes and noise) and low frequency (voltage fluctuations).
High frequency noise is caused by high power switching nearby. It is very unlikely to travel through a distribution system to a residential area. Typical sources are welders, arc furnaces, older thyristor based electronics. A variable frequency drive (VFD) on a large motor might cause this type of noise but a simple one/three phase motor would not. So I would expect in a normal residential area, the noise on the line is nether constant nor significant. If you used this computer in an industrial company that would smelt metals, then you will experience high frequency noise that is significant and potentially damaging.
The effects of high frequency noise on electronics are hard to predict, but I worked with many very large manufacturers to solve this type of problem so I have seen many issues like this. The most common problems are frequent failures of power supplies or front end components like metal oxide varistors (MOVs), capacitors, fuses, or overheated components. The next most common issue is random reboots, or data corruption. Battery failures or aging on the other hand were not a symptom seen in sites with significant noise.
Low frequency noise includes things like brownout and overvoltages. The cause of these issues can be anywhere on the electrical grid and could be caused by internal or external sources. I can see it in my house when I start my large air compressor, but it could also be caused by a large industrial company by starting the factory each morning on the other side of town. Overvoltages have symptoms similar to the high frequency noise, but accompanied by other noticeable effects such as the lights getting brighter or multiple catastrophic failures simultaneously. Overvoltages do not cause battery issues.
Undervoltages, sags, brownouts, or dips rarely (but not never) cause failures. When the voltage decreases, linear loads will run slower or less bright, but a computer switch mode power supply will actually increase the current to keep the output constant. So a dip within its ride through time (time it will supply power with no input) or within its operating range (normally 100-250 VAC) will have no effect on a computer at all. A sustained deep dip or dropout (complete power loss) will cause the power on the computer to fail, which it is protected against by the batteries within a laptop. It would be exactly the same as pulling the power plug and switching to battery.
This is the method that can cause your battery can wear out. Frequent and sustained battery use will eventually wear out your battery. But this is the same wear out that would happen if you would use a laptop on battery and then plug it in when the power is low. So a 500 cycle battery should last at least a couple of years with intermittent battery usage, but the frequent power issues could shorten the life by actually causing a daily cycle. However, if you are there, you should have noticed that there was no power for hours(?) at a time so it should not be surprise that the batteries wear out.