hamsters are prey animals and have a very good sense of smell - the scent of an unknown possible predator in the room is more than enough to make a ham panic, though often they just freeze ("if I don't move that animal won't be able to see me"). I'm not sure if Whiskers were trying to 'communicate' more than blind panic to be honest, but it's possible.
I agree with Emanon, I would keep Whiskers away from your dog, and not get her out when your dog is around. I know some people on here seem to be convinced that their dogs won't ever ever harm their hams, but there is that natural instinct in some dogs (especially terrier breeds as they were intentionally bred to hunt rodents) that could always potentially override their training, so I just wouldn't risk it!