I volunteer at an animal shelter. All summer long, I worked with the same ten dogs... my husband and I started trying the beginning of August, and I suspected it worked right away because the dogs' behavior changed. Miraculously, the energetic and jumpy dogs were super calm and careful around me. The dog I had bonded with most became very protective and frequently began licking my stomach. When the positive test confirmed it, I was even more aware of how the dogs changed...
One of the female dogs began nesting. Every time I cleaned her cage, she would rearrange the blankets and toys and then nudge me to sit in it. When I did, she would lay across my lap and look up at me. A few of the other volunteers (who didn't know I was pregnant) reported her odd nesting behavior to the vet. When he arrived and checked her, I was there. He said, "She's definitely acting like she's pregnant... but, she's not." So I had to tell him, "No, but I am! She's nesting for me!"
Maybe not every dog knows (new dogs at the shelter were still jump and bite risks, so I had to stop volunteering) but dogs that are familiar with you or are already in-tune to someone who is pregnant probably know.