Loki was totally housetrained by 1 year. It would have been sooner but he had some medical problems. We didn't get Sammy until she was almost a year, and she has about 1 accident a week. She hasn't quite learned how to tell us she needs to go out. So, Sammy's housetraining is more prevention. Loki will ring his bells, bark at me, come get me, etc.
Anyway, Sammy had diarrhea last week and she has no problem going all over the floor even though she is otherwise trained. Loki will freak out and ring his bells and cry to go outside. He would pee on the floor if he had to, but he will do whatever he can to not poop in the house. I think it depends on the dog and the level of training. If they are sick, that's gonna happen. Feed chicken and rice.