Yes, you can bring your own food and drinks onboard. Most ferries will also have somewhere you can buy food and drinks from.
On some longer or overnight sailings, there may be some areas where you can't sit and eat your own food, like restaurants or cafes, but the staff on board will let you know where you can go.