dog german shepherd

Can you give a dog (German Shepherd) of garlic?
I'm interested in making homemade treats for my Leilah but some of these call for garlic or garlic powder as an ingredient in some recipes I found. I have read that is not supposed to give dogs garlic or onion. What's the deal? I do not understand why it should be used in homemade "healthy" treats for your dog if it could be like poison to them.
Many dogs love garlic and onions – but this means adding people to candy. It is safe for SOME dogs, other dogs, however, can kill. I know people who have fed the garlic all day during the lifetime of their dogs with no ill effects (yet), others have only one tooth and will kill them. I avoid dealing with homemade garlic (or simply omitted garlic) for the same reason – I'm not willing to take the chance with the life of my dog. The question with the garlic is so tasty for the dog without garlic so it could still use the recipes – not only garlic
German shepherd dog