Fresh and animal-origin products are exactly the category biosecurity rules exist for, and this is where the harmless-looking apple becomes an expensive mistake. Strict biosecurity countries, particularly island nations with agriculture to protect, prohibit or tightly control fresh fruit, vegetables, meat, dairy, eggs, honey, seeds, soil, and live plants, and they enforce with X-rays, detector dogs, and instant fines. Even transiting passengers get caught by fruit picked up on the plane.
Elsewhere the rules are looser but rarely absent: meat and dairy from certain regions are banned in many countries due to animal disease outbreaks, and rules shift with those outbreaks, so what was legal last year may not be now.
The universal safe play: do not pack fresh or animal products at all, and if you must carry something, declare it and let the officer decide, since declared items are surrendered without penalty in most systems while undeclared ones cost real money. Check the destination's agriculture or biosecurity website for current specifics before packing edible gifts.