My 2 c worth - My wife is allergic to dogs and I am allergic to cats - so our B lives out on the porch / garden with the cats - very happily…
Of course she loves to come inside and has twice showed her territorial rights and dis-pleasure at being banned from the bedroom by peeing on the (white) bedspread.
last time it happened , I caught her , took her to the scene of the crime - spoke very sternly to her - and got "the look" - and then chucked her outside - she landed ok and sulked for a few hours but I ignored her for 24 hours except for the "bad dog" comments.
She did the same at my tenants house - snuck in when not supervised - and similar treatment there ! That was embarrassing !
That was a year ago - no problems since - I think in my case it was a territorial problem !