UC isnt an infection. It might be triggered by an infection (viral, bacterial or fungal), however.
I would assume that if it were viral...like herpes...it could coincide.
There's lots of interesting research happening on this question right now. I don't claim certainty in anything, but you also can't say absolutely that it's not an infection. They're still investigating.