Garlic is a great companion plant for tomatoes. Chives, Onion and garlic emit a pungent aroma which repels many insects. Garlic also releases sulfur into the soil that is beneficial to Tomatoes and detrimental to soil borne pathogens.
Sulfur is a naturally occurring fungicide which will help in the garden with disease and pest suppression.
It discourages aphids, flea beetle, Japanese beetle, fungus gnats, codling moths, cabbage loopers, ants, Root maggots, snails and spider mites. There is also some proof that it deters mammalian herbivores such as rabbits and deer.
Many of these pests plague tomatoes and related crops, so yes inter planting with garlic will be beneficial to your tomato plants. There are plants that do not fare well in the presence of Garlic such as asparagus, strawberries, beans and legumes. Some brassicas should also be kept away from garlic.
One companion planting scheme I use at times is the combination of tomatoes, carrots and garlic. Carrots will deter some insects that feed on garlic scapes. Carrots will deter some insects that feed on garlic and tomatoes. Tomatoes secrete a natural insect deterrent called solanine which eliminates many insects that are harmful to carrots.
Inter-planting carrots and Tomatoes requires good timing. Carrots mature differently than tomatoes so your first harvest of Carrots should be when the Tomatoes are still seedlings. Tomato plants, being much taller than the carrot, will shade the soil, carrots prefer cool soil. The carrot provides a living mulch that helps to retain soil moisture and suppresses weed growth which benefits both the tomato and garlic plants.