This works for cats; not sure if it works for dogs.

Vaseline. Rub it over the cord. They don't like the taste / smell / feel on their mouths and tongues. Only down side: as it is sticky it will attract every dust bunny for miles around! Most of my cords are behind furniture and out of sight so that is OK by me. Periodically I will wipe a cord clean and then re-apply the coating of Vaseline.