If you take your dog hiking on rockier terrain than they're used to, their paws may get injured like this. So, what do you do?
1. Be prepared to take your dog to the vet if it starts to get bloody or oozing. Make sure it's not going to be infected, at least the first time.
2. After that, you'll be able to do a more simple routine: antibiotic ointment, and some sort of sock or bootie for next time!
3. Slow your pace! Try to go more gradual to toughen up the pads after it heals. Don't just straight into the rocks with them without a bootie, especially if your dog isn't used to it.
My recommendations for ointment to prevent this is Musher's Secret, while it's healing, try using Neosporin or 1-TD for a day or two and it'll be healed in a few days.