its the high frequency & volume noise drives them mental with their hearing. its also something to do with the motion back and forth is imposing and they dont know what to do, so they bark at it.
My dog tries to eat the vacuum when its not attached to the base. He'll bite the end and it sucks his big floppy jowls inside so he claws it away and starts barking. So fucking cute!