I think both of your alternatives that you give would have given black good chances, better than either g3 (g3 was a tad more feasable) or Rxh4 would have been the simple Kd2. Kd2 gives white an irrefutable advantage in my opinion.
The tragedy of chess: "So close! What went wrong?"
rduncalfe -
Ouch! That one hurt, didn't it?
A couple of things: You did have a nice attack going - pieces coordinated, good positions, and a legitimate approach to breaking through the black defenses.
To me, your play suggested that you viewed your king as an offensive piece, and you were willing to move him to where he could help with the attack. True, late in a game, the king may become an offensive piece of necessity - but in general, you need to hide and protect him. Castling kingside early on, or queenside when you launched your attack, would have served you well, and even brought your queenside rook into the attack. I think 0-0-0 as your eighth move would have been better.
Your tenth move was excellent, taking advantage of black's mistake to win a piece. But here's the thing - so long as your king is in the open, there's always the possibility that a trapped piece can buy its way out with a check. It wasn't possible with the black Knight here, but later it did become posisble, and cost you the game.
After his 11th move, you should have won - as you know - so let's see where things went south. You've got all kinds of threats if you play Bxp(e6); he can't play pxB because of the devastating knight fork, nor does ph6 help him any - Bxpf7 looks like it's GOT to lead to mate.
f4 led to your downfall, but I'm not sure it was a bad move. Black didn't feel threatened by it; he developed another piece.
h5 launches your attach - and you're looking good until you played Bf2 in response to the check. Wouldn't Kd2 have been better? Black's got nothing else to throw at you then.
After 20. . . hxg5, you should STILL have an advantage - but I don't think Rf1 helped you. Bxp(d5) looks just a bit better to me, but I haven't analyzed it. You are correct that black's knight move wins a piece, but I suspect you were probably reeling at the reversal of fortune at this point. Once you go a piece down in the end game, it's all over, although you did have some play with the passed h-pawn, but 25. . . d4 ended even that.
Another possibility - on your 14th move, pxp(g6) looks VERY interesting. Most black responses - pxp, Kxp and pXn lead to your attack continuing, with the queen getting into the action, supported by the R.
FWIW, I see a lot to commend about your play. You're aggressive and you had a nice attack going. You'll learn from this game, painful as it was.
Well... sometimes you can leave castling, especially if you need tempo to continue your attack. Just the mistake 17. Bf2 was critical...
Out of curiosity, what would everyone see as Black's best move if 17. Rxh4? 17. ..Qxh4 seems like a bust after 18. Bf2, which I think forces the Queen back to e7 to defend against mate on f7, but then white could force the Queen to retreat further with 19. Nxd5, threatening all accessible squares on the 7th rank and making way for either a captured queen or mate on f7.
So barring that, the only move would have to be one that abandons the captured bishop and fortifies f7 in some way, probably ..Nxe5 dxe5 sacrifice to protect the d5 pawn and allow the Queen access to the 7th rank. This allows Qxh6+ with Rg4 to possibly follow and join the attack.
I don't have near enough experience to have any confidence in that analysis though, so if I missed something please say so.

Thanks to all for your responses - particularly daxelson for your thorough analysis and complements. I am still really smarting from this loss! It is so gutting to mess up an attack that has so many winning lines! Basically it comes down to the fact that even though I played inaccuracies such as 12. f4, come move 17 I should have played anything but Bf2. Oh well! I'm still fighting in our other game (just won back material after having been down for a while). I may beat him yet!
llpala - I think you are right in that Rxh4 works out. The Q would need to keep my king in perpetual check for a draw (which it cannot) or get back to defend the looming checkmate on f7. When he does this I get the rook for my bishop, and will pick up his h pawn also.
Live and learn!
I just had my most frustrating chess experience EVER in the game below. I managed to take advantage of a tactical error by my opponent in the early stages of the game, and get into a really strong position... to one move away from an inevitable check-mate. This would have been my best victory ever, over someone 200-300 points above me (you know how over the course of a game your rating goes down and theirs goes up?) Or so I thought! Getting carried away with my attack with my king uncastled left me vulnerable to a devastating last-gasp check. Could I have defended it better and still won? Any thoughts from experienced players very welcome. Meanwhile look at the tragedy as it unfolds below: