Hard disks are, for what it matters to this question, made of plates spinning and a magnetic reading head, that moves to read the disk. This head is fixed in a moving arm and it's positioned very close to the disk.
If you shake the HD, the head might touch it's surface. So, it'll cause damage. In the long run, it'll make it worse, as the micro- and mini- and regular- damages will acumulate.
So, never shake a running HD.