I took sandwiches on once, along with a bottle of pop. No one stopped me, but that was back in 2003, and things may have changed.
Bringing it on the boat is no problem at all. Consume (own brought) alcohol with a little bit of decency and you'll be fine.
And of course own foods/drinks are not allowed in restaurants and pubs (so either your cabin or one of the places where there isn't a bar/restaurant).