Dogs can contract a UTI by exposure to E. coli, Proteus, and Staphylococcus. Generally, a good diet can prevent a UTI.