Places like Hogwarts are purely fictional, the invention of an author's imagination. The things that the kids in the Harry Potter stories learned in school cannot be done in the real world.
I think it should be a genre. Here is the definition from Wikipedia: Magic realism, or magical realism, is an artistic genre in which magical elements or illogical scenarios appear in an otherwise...