Dogs need cool air to exchange for warm air. Then take the dog to a vet as soon as possible. Leaving the windows open a crack or parking in the shade does little to alleviate the heat. Check before the hike to see that your dog's nails are medium length. Long nails will make your dog's feet hurt.
Short nails interfere with traction.
Top Check for and treat cracking, punctures, or sores on foot pads. Your dog needs to have tough pads. If he lives and walks only on soft grass, he might have a problem hiking on trails that may be hard or rocky. A dog's pads should be rough and look like fine sandpaper. Check for and remove foxtails and other weeds.