I’ve cut down several memory foam toppers. It’s easy to do, but a straight factory edge is hard to achieve.
You can cut memory foam with a pair of scissors most easily. It gives a slightly ragged edge, but might not matter if you are going to put it in a fishing boat. It gets covered with a fitted sheet anyway.
If the topper is going into a luxury yacht, then you will want better results. Use a straight edge and box knife or really sharp knife. Mark the cut line with a pencil. Place the topper on a firm flat surface, like a piece of ply wood, and press down along the cut line with a stiff straight edge, like a 2 x 4 board. It will be easier if you get someone to help you hold the board down. Then cut along the pencil line with box knife as neatly as you can. Again the results won’t be perfect, but once under a fitted sheet, the slightly crooked edge won’t be noticeable in form or function. And once the bed is made up with a comforter or bedspread, even a critic would be pleased.