During the hot summer months some folks look at their panting dog and think, "all that hair is making Rover hot!" No it isn't. Rover is panting because it is hot outside, because it is summertime.
Dogs don't sweat through their skin like horses and humans do. Dogs pant to help regulate their body temperature. Panting cools the body by evaporation, similar to sweating. The dog also has a handful of sweat glands in the foot pads but panting is the dog's primary source of evaporation to cool the body.
Dogs have a coat of hair that insulates their bodies from both heat and cold. The coat holds in air close to the skin. This trapped air is the same temperature as the dog's body. So conditions outside the dog that are not ideal (not body temperature) are kept away from the dog's body by his coat. Cut off the coat and the dog's insulation is lost.
It is better to groom the dog so that his coat can better do its intended job. Matts in the hair muck up the insulation ability of the coat. A well combed out coat can efficiently insulate as designed. Unless you have a dog such as a Poodle or Schnauzer, whose coat is kept trimmed all year, don't cut off your dog's hair thinking you will keep him cool.