Yes, we call these companion plants, which are grown next to tomatoes that help keep pests away from the crops being grown. A popular choice gardeners use to do this are marigolds which also don’t take up too much space.
Poached egg plants, fennel, dill and yarrow are also good tomato companions, because they attract beneficial bugs, such as ladybirds, which eat other insects that will damage your crops.
Finally, planting mint near tomatoes not only deters pests, but it also improves their health, enhances their flavour and provides you with a nice herb for the kitchen and your drinks!