Dogs can absolutely get bladder infections. Urinating in the house or a change in behavior is generally your dog trying to tell you something. Always know your dogs habits and take them to the vet.
My 5 year old rescue bulldog was in heat when she was spayed. On the 2nd day after surgery she started urinating a little blood and whining. We promptly went to the vet and he tested her urine and she had a bladder infection. He prescribed her antibiotics and administered a shot. After a few days she wasnt getting any better we returned to vet. His suggestion was to stop the pills and come in every morning for a shot to be administered. After 2 weeks she finally got better.