Question: I’ve read that tomatoes are self-pollinating. Does that mean I can collect seed from two heritage tomatoes growing side by side?
Answer: Indeed, tomatoes, or at least domesticated tomatoes (Solanum lycopersicum), almost always self-pollinate, that is, produce fruit with their own pollen.
Definition of self-pollination: the pollination of a flower by pollen from the same flower or from another flower on the same plant.
The tomato flower is essentially closed, as the pistil (female part) is shorter than the stamens (male parts) that form a protective cone or tube around it. Thus, bees and other insects have no access to the stigma at its tip. Instead, bees (especially bumblebees) buzz pollinate: they shake the flower, releasing pollen which does fall on the stigma, so a fruit can form. Wind, too, can cause pollen to be released and a fruit to form. (Lacking bees and wind, tomatoes grown in greenhouses often need to be hand-pollinated.) But the pollen is from the same plant, in fact, the same flower (this is called autogamy), so the tomato is effectively self-pollinated.
That said, some rarely grown varieties of tomato as well as ancestral forms (wild tomatoes) have styles that do extend beyond the staminal cone and are thus easily cross-pollinated. And there is also always a possibility that, even on a classic garden tomato, a flower could be malformed, with a stamen cone incompletely closed or a pistil just a bit too long, and that could result in cross-pollination.
For the average home gardener, the risk of cross-pollination is so low that yes, you could certainly plant two heritage tomatoes or other non-F1 hybrid tomatoes next to each other and harvest the seed for your personal use, expecting to maintain the same variety year after year. If ever there was a stray cross, you’d know it, as the fruits would not be identical to those of the previous generation. You could still eat such tomatoes, but you wouldn’t want to keep their seeds for the following year.
Those saving seeds for a heritage seed program, where exact purity of the line is vital, should follow that organization’s guidelines. Some recommend a 10 to 50 foot (3 to 15 meter) isolation distance for tomatoes.
For information on isolation distances for other vegetables, read How to Keep Vegetables From Cross-Pollinating.