Who would strike first. Vader with a lightsaber and force choke, Or Potter with a wand. Does Harry Potter have enough magic to tear up a star destroyer or death star? If he had wizarding allies with him, Then death to the Empire since the Empire consists mainly of humans with blasters and jets along with technicians and Emperor Guards. The only ones in the Empire with true power are Vader and Palpatine and even Vader's past love weighs him down.
Really there is no way Harry Potter wins. Star Wars wins for 3 simple reasons. It's just the universe isn't close.
1-Technology. Death Star, Just blow up the planet. Imperial-class Star Destroyers. Tai fighters would be a pain. I do think they might stop some of the land base, But Empire has near endless of these things.
2- Numbers. Even if the canon fonder storm troopers would be enough to bring Harry Potter universe. The low accuracy of storm troopers wouldn't be a thing, Because main character immunity would be gone. Good will not always too.
3- Force is broken. Well magic is strong. I'd think the original force (4 to 6) magic would win, But thanks to the extended universe it's too broken. Vader and Palpatine, Even on the ground would be deadly. Vader. Force can figure out weaknesses. Vader beat an army of rebels solo.
Plan and simple, The empire is too great.
Death star would destroy earth along with all of harry potter's allies. If you took the battle to the ground, The vast and near limitless resources of a galactic wide empire would absolutely crush the wizards even with all their magics. In a straight fight, The wizards win over imperial troops because they can block energy blasts and disarm/stun with the flick of a wrist. However, There would be too many for them to fight back. Vader would likely loose to Harry as he has no defence against magical attacks.