The point of Dune is to be a dystopia, though. As the story unfolds, every well-meaning character ends up sacrificing not only themselves, but all they hold dear, for the Greater Good.
Rowling's story is special in that it justified horrible with worse. In that way it's a kin to Norman Spinrad's Iron Dream, which is a pulp-scifi story as written by Adolf Hitler.
cc: @dalias @yojimbo @seachaint @leadegroot @MostlyDrawing @Unixbigot