My family's first dog. Sheba, was a female stray who came to us as an adult. With her it was definitely a "territory marking" activity. She was the Alpha dog of the neighborhood, and led them on a daily patrol of more than a mile, and she lifted her leg to mark important stops.