It works differently.
Ozone is a strong oxidant. Typically used in protein skimmer where people wants to increase the protein skimmer's performance by adding ozone to extract more protein waste (oil, fat, ammonia, nitrite and some nitrate...etc.) out of water. Too much ozone in the water can be lethal to tank inhabitants as well. That's why it is recommended to use redox/ORP monitor in conjunction with Ozone.
UV is more intended to "zap" microscopic animals in the water. As small animals are exposed to UV rays, UV alters the DNA of the outer shell, thereby killing or disabling the animals. Obviously, depending on dosage, UV works much more efficient for single celled animals such as algae (OK, maybe not just animals), ich parasites, and a number of other bacteria. For larger more complex animals (such as adult shrimps, fish...etc), it would require a much heavier dosage or longer exposure to make noticeable damages.
The key to UV usage is to make sure you lengthen the exposure time as long as possible, hence the "spiral" design of some UVS manufacturer.