our family dogs always used to get fed human food left overs, and that often included onion. The main problem with that was the pong of dog guts having revenge later. A little bit probably won't hurt unless the dog has a severe allergy in which case I think you'd have noticed. But I'd avoid making a habit of including onion in doggy diet.
Garlic - in very small amounts seems to be ok, approved even. Go figure. The humans I know who are allergic to onion - can't eat garlic either.