Most ports do not allow you to bring food items off the ship and vice versa. The concern is local food safety at both ends. Carnival will not pack you a lunch.
I have seen it work both ways. I have seen people bring food off the ship - nobody seems to check very carefully - and I have seen passengers lose those woven palm frond hats coming back on board.
A Bad Day At Sea [with power] Always Beats A Good Day At Work
Carnival: Glory 2004, Destiny 2008, Splendor 2009, Freedom 2011, Valor 2012, Dream 2013
Celebrity: Summit 2011
Princess: Ruby 2010, 2014, Caribbean 2013, Coral 2014