Nothing is guaranteed, as deer and hares may eat almost anything if they are hungry enough, and once they find a garden they like, they tend to return again and again. Also, some things may be location dependent - I've read that hares don't eat yarrow, but they do in my front garden - just the flower buds! I don't have a problem with hares in the back yard, as I have a dog, but I have a friend who says planting lots of onions in the veggie patch seems to keep the hares out.
If you live in the country, the only real way to keep deer and hares out is a fence. But in the city, deer and hares generally avoid plants with silver or grey leaves, and plants with fragrant, hairy, leathery or prickly leaves. Here are some plants that will likely discourage them: