Yes you can plant cucumbers alongside tomatoes and they will grow and do just fine.
However when cucumbers are planted alongside potatoes, sage, and melons the cucumbers don't grow so well.
But planting tomatoes and cucumbers together will work just fine and you can also plant other things alongside cucumbers such as beans, peas and nasturtiums.
Cucumbers and Tomatoes are good growing companies and actually planting them together seems to help them grow much better.