I have no definite answers but might have some insight.
She is probably house trained at 'your" house. Taking her somewhere new and showing her where to go, etc, just may not compute. She still is a puppy and training needs to continue outside your home. Add to that,she may be a bit nervous or anxious in a new environment whether she has been there before or not. Add to that, she "may" be marking or smells other animals that are or have been there.
I think what you need to do is continue your training outside your home. If you go visit someone, keep her on a leash so you have control. Like at home, if she is loose and pees or poops inside, immediately tell her "No!" And take her outside. She has to learn that is not acceptable especially if you know she has just done her business.
Good luck!! Keep up consistent training and don't give her the opportunity.
I forget to mention this is at my pet sitters, or friends homes where I am taking care of their pets. I also forgot to mention this is something new.
I think I'd leave the dog home until she gets older and more adjusted..or if a small dog (your pictures) and if you have a crate, keep her in the crate at other homes when she isn't being played with or petted.
A professional trainer should have some better ideas and hands on training.. but I have so far never hired/paid for dog training.