Zucchini and Cucumbers can indeed be planted next to each other without worry of cross pollination.
Although Zucchini and Cucumbers belong to the same cucurbit family they are different species of fruit it's safe to plant both Cucumbers and Zucchinis together.
Zucchinis and Cucumbers do pretty well when planted together and planting them together will not decrease the quality of the cucumbers or zucchinis.
You can also plant squash alongside cucumbers and zucchini and they will too grow together just fine without any fear of cross pollination.