I'm not a professional but I think what you're talking about is called a bitch stripe. It is common in female dog and I don't think it has anything to do with genetically anxious dogs, but I could be wrong. At first I thought I had an anxious dog because he didn't like strangers to pat him on the head and would bark at some people wearing hats. He did this for approximately 4 months. Now at 14 months he is fine however he still doesn't like some people to pat him on the head but it has nothing to do with whether they are wearing hats or certain clothing go figure. He is also great walking through crowds and being around other people he just does not look for attention. how old is your dog? He could be going through the stage also.
Dexter Bartolomeo -GSD (24 months)
Fluffy Cornelius - Maltipoo rescue (approx 7yrs)
Squeezette Antoinette- Shih Tzu (16 yrs)