I've never done it but have heard of people doing it off plastic piping or they run a split line off the plastic piping so they can control flow. I don't think I've heard of anyone doing what you're thinking but makes a lot of sense. Did you try googling inline uv
units - fittings I thinking might be hardest part. Also depends on what you want (eg green algae control would be fine), but UV
units generally do better with slow flow for more residence time against bulb, we tend to prefer high flow in filters.