In High-School, my friend and I were amongst the most popular: We spent our days missing classes and playing basket ball and football, we got used to our "fandom". We were known to the Administration by first names. And of course, when you were seen around a lot, people knew who we were (even years after).
But to come back to the point: I have been blessed and lucky in my life. I did sports (Judo (since age 6 or so to 17, competitions with lots of people, trained with many boys and girls in my club, both my age and older), football (many, many people cheering at your feats helps), basket ball, running, working out (body weight only)).
But I was also pretty cute, dressed nice, and was clean. These points lack to a lot of nerds (Cuteness isn't something you can change, but you can take showers and dress respectably).
I was also blessed in the sense that I hang around girls since I could remember, like since I could talk. And I hang with a clique of older girls and guys who had me, and few other girls and boys my age with them, so I had a lot of socializing way before I got to high-school. Having girls have a crush on you wasn't a big deal, it was all part of normal.
So it's not the same thing, when you already had thousands upon thousands of interactions with people, and if you only talked with one friend or something.
There are things they can do, though, and it's not to be popular per se, but if I were like those kids who had it hard growing up (like being mocked or stuff like that), I would ask myself questions and hack it. It's not even to fit in or something, but taking showers and dressing okay doesn't make you less smart.