There are plenty of sewing projects to do on a boat. We carry a sewing awl (Speedy Stitcher) to make quick repairs without a machine. Inside the body, there is space to hold a fair quantity of thread. We use it to repair heavy canvas and sails.
The Speedy Stitcher comes with diamond point needles, and heavy waxed thread. It sews a perfect lock stitch just like a sewing machine. With it, we're repaired our sails, our backpacks and our boat canvas.
To make more complex projects involving thin fabrics, we use a sewing machine. Our machine is nothing special (we can't even go in reverse with it), but it does basic stitching and works quite well, plus it came with a briefcase which helps to protect it against moisture and corrosion. When making repairs for outside project, we use UV-resistant polyester thread. See our mini dodger.
Repairing sails aboard a boat is possible, but difficult. Tables on smaller boats are too short and narrow, and the space makes it too hard to lay panels flat. For such repairs, we try and seek out outside space to do the work. While in Minamiise in Japan, the harbourmaster let us use the yatch club's loft, as well as their machine to fix our headsail.
The typical machine that you'll find on sailboats is the Sailrite. In our travels we've borrowed our friend's Sailrite a few times, they eat through thick industrial canvas.