Sealed, commercially packaged dry goods are the most forgiving category in any customs regime. Packaged snacks, tea, coffee, and most dried spices travel fine into the majority of countries, in either checked or hand luggage, as long as quantities look personal rather than commercial. Original retail packaging with ingredient labels makes inspections quick; homemade or unlabeled foods invite questions because officers cannot verify contents.
The caveats: strict biosecurity countries scrutinize even packaged food, and anything containing meat, dairy, eggs, honey, seeds, or fresh ingredients can be restricted regardless of packaging. Some spices and plant products are also restricted where they count as seeds or unprocessed plant material. Hand luggage adds the separate aviation rule that pastes, sauces, and liquids over the security limit belong in checked bags.
Two habits keep you safe everywhere: declare food whenever the arrival form asks, since declared items are simply inspected while undeclared ones draw fines, and check the destination's customs or agriculture website when carrying anything beyond obvious sealed supermarket goods.