Will a dog pee out of spite?
Also question is, do dogs do things out of spite?
While dogs have emotions and complex thought processes, a dog's reasoning is different from a human's. To truly act out of spite, your dog would have to share your view of right and wrong and use that shared moral code to guide his behavior. Dogs don't function that way; they are motivated by outcomes, not morals.
In this regard, why is my dog peeing in the house all of a sudden?
If your dog suddenly starts peeing in the house (or other unacceptable places), it could be caused by a urinary tract infection. Other possible urinary issues your vet might find include cystitis (inflammation of the bladder), crystals in the urine, bladder stones, structural abnormalities, and even tumors.
As you probably know, dogs urinate instinctively to mark their territory. Often, dogs feel the need to protect their domain. This often occurs when your dog feels challenged at home. For example, a new baby in the house can take attention away from your dog, triggering aberrant behavior.