EDIT: Accidentally duplicated post. Please see https://startrek.website/post/25896182 for all responses.
Harry Kim got addicted to clarinet
For the first part, why he doesn’t have a formal education: Nog is living on a space station with his uncle and father. Not in a Ferengi society. The Uncle doesn’t want to shell out for an education for the kid cause he’s Ferengi and doesn’t want to pay for things, and the father just goes along because he’s kind of a doormat. There’s not enough opportunity for job-shadowing that allows Nog to learn from a Ferengi mentor that’s capable of teaching such things as literacy, so he remains ignorant. Also explains why he gets into so much trouble (aside from the bad influence of his uncle), as he has too much free time from lack of mentorship.
He also shows that he’s very hard working when he applies himself. So, in addition to tutoring from Jake and probably Keiko, he just buckles down and does the work. Especially when he gets to the academy. He specifies in “Homefront” (Or “Paradise Lost”, I don’t remember exactly) that he’s doing all right at the Academy. Not excelling, so he’s struggling. Probably not the least of which is because he’s behind in education as compared to his classmates.
Nog went up the ranks more quickly because of the war, which provided him with many opportunities. Also, his connections, which allowed him to intern on DS9 and the Defiant, again in the context of war.
Harry was on a ship isolated from Starfleet. If Janeway had promoted everyone who had the merit, she’d have had a ship full of commanders and a handful of captains by the time they got home. But most of those people would have had to keep doing the same jobs, anyway.
But the true reason for the discrepancy noted by OP is just down to the fact that Voyager’s writing team just wasn’t as good as DS9’s (or they were held back from above). The only characters to have a meaningful arc on Voyager were the Doctor, and Seven. The others mostly just had to reset at the end of every episode to preserve the show’s episodic nature.
Harry never got promoted because the writers never figured out how to evolve his function on the show. Now, I assign a small part of the blame to Garrett Wang himself: he rarely gave performances that stood out and made the writers want to write about him more. But most of the blame goes to the writers and show-runners.
For example, if they’d exploited dual crews more throughout the series, with more conflict, etc., Harry might have found a place. Imagine if the Maquis crew had had their own ship for a big part of the series? Harry, eventually frustrated at being passed over for promotion, might have joined them!
He was a DEI hire.