They both do slightly different things so ideally you would use both.
UV is good for clearing green water, bacterial blooms, and for managing parasites such as ich. If the flow through the UV is dialed in right it will destroy the DNA of parasites passing through and they won't be able to reproduce.
Ozone is primarily for achieving ultra clear water. The ozone reacts with all kinds of organics in the water and breaks them down. It can pretty quickly remove any yellowish tint from the water and make it look like the fish are floating in air. I haven't found any good information on the effectiveness of ozone against algae and parasites, but it seems the general consensus is that a concentration of ozone sufficient to kill parasites would also be harmful to fish and corals. To run ozone safely it should ideally be paired with an ORP monitor.
TLDR: UV for algae and parasites, ozone for clear water