@oristarA,
"Hagrid" is actually the character's last name (his full name is Rubeus Hagrid). He goes by "Hagrid" and by that point, he'd been called "Hagrid" by many other people and had introduced himself as such.
In my area of America, children are supposed pay attention to how an adult introduces him- or herself. Usually, an adult should be addressed as "Mr./Mrs. Lastname" unless he or she says "Oh, you can call me Firstname."
"Hagrid" is unusual there because he is addressed by just his last name. Almost all of the other adults in the Harry Potter books are addressed either by their first names (Sirius) or with an honorific (Professor [character's name] or just Professor).