Dry ingredients like flour, cocoa, and so forth are best measured in weight. If you scoop the ingredient with the measuring cup instead of gently spooning it in, you will pack the cup, increasing the weight of the ingredient. This is true whether you're using ounces or grams.
Volume measurements (cups or milliliters) are a handy shortcut for liquids, or ingredients that don't compress (like white sugar).
For something like coconut or finely chopped almonds, you run into a different problem.