Will a consumer UPS clean up power from a conventional genetator
A regular consumer UPS will keep the voltage within acceptable limits for electronic equipment, but it won't do much cleanup of electrical noise or irregular frequency while it's powering the equipment from the mains power.  That's because they're designed to supply mains power as long as it is available.  The battery kicks in only if the mains power goes out or drops below a minimum threshold.  Surge protection protects against high voltage spikes.

An "online" UPS will do what you're asking.  With these, you always operate off the battery, so the output is a constant voltage, constant frequency, and noise-free.  The mains power keeps the battery charged when it's available.  Voltage or frequency fluctuations, noise, or other problems don't affect their ability to charge the battery.

That's the basics.  Unfortunately, things are a little more complicated as far as what you can actually buy for the kind of application you have.  Many products are actually hybrids, particularly in the size used for home electronics.  This discussion by APC describes the technologies available and what they can do as far as cleaning up messy power.  You can use that to compare the products available (and their costs).  Here is some summary information from that link:





As you can see, the technology that does what you want is generally expensive or impractical for applications smaller than commercial use.  But at least you have the information to make a more informed decision.