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.
All I ask is a tall ship and a star to steer her by; John Masefield
Carnival: Glory 2004, Destiny 2008, Splendor 2009, Freedom 2011, Valor 2012, Dream 2013
Celebrity: Summit 2011
Princess: Ruby 2010, 2014, Caribbean 2013, Coral 2014, Regal 2014, 2016
Sail Windjammer: Mandalay 2017
Star Clippers: Royal Clipper 2015