Pumpkins and squash belong to the genus cucurbita. There are different species of cucurbita, and different varieties within the same species can cross-pollinate each other. Crossing does not occur between varieties in different species.
Cross-pollination will not affect the fruit produced by either plant. Cross- pollination is not a concern for gardeners unless they want to save seed of a particular variety to plant. Cross-pollination between two varieties in the same species will produce hybrid seed. Planting these seeds will give you plants with some characteristics of both parents. Most natural crosses produce offspring with less desirable characteristics than the parent plants.
Varieties in the same species must be separated by a distance of at least ¼ mile to prevent honeybees from cross-pollinating flowers. To prevent cross-pollination in a small garden, do not plant more than one variety from the same species. If you grow two or more varieties in the same species and want to save seed, the flowers of each variety must be hand-pollinated to prevent cross-pollination. The procedure for doing this can be found online with a search for “Hand Pollinating Squash”.
By V. Lazaneo, Urban Horticulture Advisor, Emeritus, UC Cooperative Extension, August 2012