Answer :

Because dogs have their bodies covered with fur, sweating is less effective. Dogs have sweat glads in places where there is little fur. However this is not enough in some hot days. To keep the body temperature in order dogs have to rely on panting. The interior of mouth and lungs is wet, so breathing quickly speeds up cooling. It acts similarly to wind blowing on sweaty person's skin.

You can try it on your own. When you breathe heavily you will feel coolness :)

In order to evaporate (change state from liquid to gas) heat energy has to be delivered to water. The heat energy is taken from the body of dog, thus cooling it.