Yes cucumbers and tomatoes can be planted together and they will grow just fine.
The cucumbers and tomatoes are good companion plants and will grow very well together.
Cucumbers and Tomatoes are also good to grow alongside of beans, nasturtiums as well as peas.
For the best growing tomatoes it's best to start the tomatoes out indoors before the outdoor growing season and then when growing season outdoors starts transplant the tomatoes to outdoors.
You can start tomatoes six to eight weeks before outdoor transplanting and for cucumbers the cucumbers only need three to four weeks from seed to transplant.
I've planted cucumbers and tomatoes together after planting them indoors first.