Vegetarians can absolutely eat garlic because it is considered to be an herb and has nothing to do with animals in any way. In fact vegans who are not allowed to eat any animal meat or animal byproducts can also eat garlic because it is not fall under any of these categories.
Garlic is also extremely good for you because it contains lots of minerals and nutrients as well as vitamins which are good for the body. It has also been proven to help with certain health problems like high blood pressure and high cholesterol. There are lots of great vegetarian diets that involve garlic so if you are a vegetarian it might be a good idea to look into some of them.