Many fantasy novels deal in pure fantasy, meaning that they invent entire worlds. In the typical fantasy novel, the world inhabited by the characters may resemble our own, but it will generally be a completely different world, especially when "fun" or interesting objects such as transportation are concerned.
Harry Potter conforms to this when it comes to elements like dragons, evil warlocks, etc. However, a main theme in the Harry Potter series is that of common objects made magical, such as a magic train accessible through a secret entrance. The flying car fits into this nicely but goes against the usual expectations of fantasy.