One of the best ways to prevent Urinary Tract Infection in dogs is to keep them well hydrated. Give your dog plenty of clean water every day, make sure they can have unlimited free access to drink (clean) water any time they want.
You also need to make sure they urinate plenty of times too. Do not let them hold it when they must go. Urine in their bladder can promote bacteria growth. Take your dogs out for a walk often, to promote them to urinate. The bacteria that may cause the infection would be flushed out with the urine.
I have also heard that let the dog drink a little orange juice might help too. Orange juice is slight acidic, and it can make the dog's urine acidic. Bacteria do not like acidic environment.
Give your dog a good balanced diet is also important. Remove uneaten food to avoid bacteria growth. You may also choose those dog food with really small tiny amount of garlic supplement in them. Garlic can boost the immune system in mammal. However, over-dosage of garlic can cause problem for dogs such as the breakdown of red blood cells.
Take your dog to a veterinary often for regular checkups. Many problems can go unnoticed and they would only get worse if not treated on time. Urinary Tract Infection is included of course.
If your dog already has Urinary Tract Infection, there are plenty of antibiotics for this problem. Cephalosporins, Simplicef, Baytril, Ciprofloxacin, Orbax, etc. can all cure UTI.
Different bacteria strain might have different level of resistance to a certain antibiotics. You might be required to try more than just one of them to have any positive effect.