On-top-of-fridge storage
The top of your fridge might tend to be a relatively warm spot in your kitchen: it's up high, and the fridge itself gives off some heat. Exactly how warm would depend on your kitchen and your fridge.

So it might not be the best spot for spices, since heat can make them age and lose flavor more quickly. Some other foods also prefer relatively cool storage.

Otherwise it should be totally fine; most things can handle being slightly warmer than the rest of the kitchen.