Goats aren't stupid!
They are browsers by nature so have a very good survival instinct and will not, under normal conditions of plenty, eat anything poisonous. They might nibble at, for example, laurel, which isn't good for them in quantity. But they won't eat enough to cause any harm.
Nettles are good for them and if you cut them and allow them to dry, the goats will eat them with relish.