Yes, although it’s not always the main reason. But lower-quality food may not have the proper balance of minerals and nutrients that aid nutrient absorption. If this causes your dog’s pH levels to lower, bacteria that causes UTIs thrives.  Be sure that whatever food your dog eats is balanced in vitamins and minerals that suit them. And, you can consult with your vet if problems persist, even if switching foods.