They don't mind each other's company, but being in same soil can be little challenge as tomatoes like bit of moisture and stronger feeding. But even in same soil, if you grow other crop in bottomless pots, then each can have right conditions for the roots.