Learning to go outside at one house doesn’t mean they understand they need to go outside at all houses. That’s especially true if the unfamiliar house has a dog also, so a male dog will want to mark over the scent of the other dog.
The good news is that once they’ve learned to go outside at one house, it’s generally easy to teach them at other places.