First of all it has nothing to do with dogs!
The term is a throwback to the Ancient Roman who thought that Sirius – the Dog Star – added its heat to that of the sun from 3 July to 11 August creating exceptionally high temperatures.
The Romans called this period ‘Dies Caniculares’ or ‘Days of the Dog’ – hence the reason why hot days are sometimes now referred to as dog days.