There are strict rules against taking raw (unpackaged) foods off a ship.
And as guest in these ports, we need to be a good steward and follow their rules.
However, prepackaged foods are completely acceptable.
We have a son with Autism that won't just "eat anything"...so we pack prepackaged peanut butter/crackers, candy bars, chips....
you can even carry off boxed cereal from Lido.
We also time our port visits so that we can eat a big breakfast and be back in time for a late lunch. This works best for him.