Well yes "geek" and "nerd" were originally uncomplimentary terms. Anyone who was actually called those words in their school playgrounds knows that. The former was a comparison to circus geeks, a common term for performers whose acts included seemingly gross or foolish stunts such as hammering nails into their nostrils or eating dangerous items.
It's very, very common for once uncomplimentary terms to transform into neutral or positive descriptors. You could fill a book with examples, and many have done.
--Uche