Dogs have a heightened sense of hearing and so the loud clap of thunder startles them and causes them to become very scared. Most of the time after a few claps of thunder they get used to a little more and will come out of their hiding space.
The canines don't know from where and by whome thounder is created.The decibal hearing is higher than the human, naturally the great sound make the dogs go frightened.
Canines are not a huge fan of thunderstorms, usually because of the loud noises coming from the sky which would be thunder! And also, they don't like flashes of brightness, such as lightning.