Yes there are UPS that have a mode of complement, which means that if the sine wave of the GRID SAGS the UPS balances the output to maintain the sine wave complete, also if the GRID power goes OFF the UPS will continue supplying the power without any sine wave glitch transition.
These type of UPS with a very light modification can be used to supply energy to the GRID.
The UPS is synchronized to the GRID frequency but it is not producing any voltage or power per se, the circuitry is following the GRID voltage and Current and if a discrepancy is present the UPS generates enough voltage and power to keep the GRID power clean and correct from a few volts to total power if the GRID goes away.
It is a more complicated design = like a GRID tied Inverter.
Nando