You are going to get a multitude of answers here.
We’ve brought food onboard before but in some ports, it’s strictly prohibited.
We have seen big trashcans full of restaurant food in LA and in SF but then again, we’ve brought hot lunch back for some of our favorite crew members that couldn’t get off the ship while in port. It really depends on the port so, just ask when you get off the ship to find out their rules about bringing non factory sealed food onboard.