Yes, in a certain sense, although a slightly more accurate characterization might be that Harry Potter is a nerd's idea of a hero. Although I have to admit my knowledge of the series is rather superficial, so perhaps I'm wrong.
> he definitely never did homework or studied and lucked into every solution he ran into by dumb luck.
Nerdy doesn't necessarily imply industrious or studious. I wouldn't say the average MtG or DnD player was a particularly good student at my high school.
Rethinking through the series, which I have re-read within the past year, the only truly nerdy moments he has all involve girls; and then only really at the beginning of his involvement with girls. Very quickly, he begins to have quite mature thoughts regarding his relationships, even if he doesn't always make the right choices.
Tina Fey also did a good exploration of this idea in 30 Rock S3E5 "Reunion" when Liz Lemon has to face the reality that she wasn't the nerdy victim but the bully. It's a recurring theme in media because no one ever thinks they're the bad guy. It's especially hard to tell when you're young and haven't learned how to be a human yet.
All that said, I don't think Harry was a bully. Malfoy was pretty unambiguously antagonistic. Snape was more antihero, but did make a point to antagonize Harry when he could. Harry mistook the antagonization as evidence that Snape was up to bad dealings because "I'm the good guy and my enemies are bad", but even this gets flipped on its head throughout the series. Malfoy doesn't become humanized until they show his family life in detail and even then he only redeems himself in the home stretch.
Hermione was nerdy, but was usually made fun of for being nerdy, and was a love interest despite her nerdy ways.