I'm not sure if this helps but I think having too much sodium in their diet affects the probability of getting UTI. After all, that's what happens with humans.
As Ram had mentioned, it is important to have water readily available and it must be clean as dirty/unchanged water can be a breeding ground for of bacteria. This also stands true for left over food.
Cleaning their food and water bowl is important.
Lastly, orange juice or any citrus drink is good is because it makes the dogs urine more acidic. It also helps in reducing the pain associated with UTIs. Some dogs don't like drinking acidic juices.