Cooking them
If you're cooking them with just heat...peel after you cook If you're cooking with heat & other ingredients...peel before you cook
I know the pho recipe I use has specific instructions to leave the skins on the onions that are used in the broth. Also, roasting whole bulbs of garlic unpeeled is a pretty normal thing to see. In general I peel, but there's specific cases for not peeling.