Yes — solid food (sandwiches, fruit, snacks, chocolate) is fine in carry-on. Liquids and spreads (soup, yogurt, hummus, jam) fall under the 100 ml rule. Fresh produce and meat may be banned on arrival in another country.
Security and customs are different checks. Security cares about liquids and gels: a sandwich passes, a tub of yogurt over 100 ml does not. Cheese, cakes, nuts and dried fruit are fine. Peanut butter and soft cheese count as spreads.
Customs on arrival is stricter: Australia, New Zealand, the US, Japan and many others ban or restrict fresh fruit, vegetables, meat and dairy from abroad. Declare food if in doubt — fines for undeclared items can be steep.
On board: most airlines allow your own food; some ask you not to eat strong-smelling items. Alcohol you bring on board cannot be consumed unless served by the crew.
Related questions
What is the 3-1-1 liquids rule?
Each liquid, gel or aerosol in your carry-on must be in a container of 3.4 oz (100 ml) or less, all fitting in one quart-size (1 litre) clear bag, one bag per passenger. Medications and baby food are exempt but may be inspected. Full answer →
Airline, airport and government rules change without notice. Treat this as a starting point and confirm with the airline or authority for your specific trip. Request a correction if something is out of date.