You could make that argument about Dune, I agree. You could say that the story of an empire changing hands from one dynasty to another and all the convoluted political machinations could be transferred to historical fiction or to fantasy with minimal changes. But I think its science fiction elements are more important to the story and its themes than is the case with Star Wars - Herbert's anthropological musings about religion, for example, or the evolution of the human race, even the political aspect is more an extrapolation of human politics to a galactic scale rather than a transposition of politics to a never-never land that could just as well have been a fantasy setting as a futuristic SF one.
Star Wars, OTOH, I don't think is concerned with much beyond the basic adventure story, or if you prefer, the hero's journey narrative, a la Joseph Campbell. IOW, while the SF setting provides a certain feel or an atmosphere different from fantasy, I don't see that it does much else.
As I said before, I don't see the division as a hard and fast one. But take something like, say, a Green Lantern comic: takes place in outer space, has extraterrestrial characters, etc - but despite those SF trappings, I'd still call it a super hero story, first and foremost.