Sorry to hear about the pooch
Animals are euthanized depending mostly upon weight but also species.
Dogs are either given a barbiturate overdose or an anesthetic agent (so no pain is felt) followed by potassium chloride which short circuits the heart causing a fatal heart attack.
Some barbiturates and anesthetics can be introduced through the skin but if immediately washed off the skin there is no chance of adverse reaction for you.
It sounds like your dog got the second procedure. You will be fine and delaying the potassium chloride would not have caused any discomfort to your dog as it was sound asleep at the time. Its a very nice way to go if its time.