Not because of UTI. Uti is short for urinary tract infection. That includes bladder infections as well as kidney infections. They are usually caused by bacteria which will not cause herpes, an infection caused by the herpesvirus. However, someone with a UTI can also have herpes which is not always visible as sores. The virus can then be transmitted to others through skin or mucous.
Yes and No. Someone who has a self diagnosed "bladder infection" could in fact have herpes, and it is possible to have both at the same time. But no, you could not get herpes from someone who doesn't have herpes but just a bad bladder infection. The infected person needs to be seen to determine which s/he has and to get some relief! and should only be having protected sex---if sex is even desired right now.