Can a dog have an anxiety attack?

Yes.