It's understandable that people compare The Dark Knight with The Avengers, since the former is probably the most loved superhero-movie and the most succesful one.
But it's really hard to compare them since Nolan goes a completely other route with Batman than Marvel/Whedon does with it's heroes. The Avengers is lighter, brighter and funnier while TDK has a deeper story and all that psychological stuff.
But personally i can't tell which i like more. They are just too different. Besides i just saw Avengers and i can't wait to see it again.