The accepted answer here is right in an important respect, and wrong in an important respect. It has been pointed out in comments but it is worth writing it out as a full answer.
The difference is insubstantial as far as long rests are concerned.
This is true. How that technically works is, given your first long rest after having full hit dice, the HD-then-HP order takes you over your hit dice maximum, and those extra 2 dice then vanish into the aether. So if you then use up 3 hit dice, your running total is 2 HD and at your next long rest you have two more to spare, so you can heal a maximum of four hit dice. If you follow the HP-then-HD order, no dice vanish into the aether and your running total is 4 HD and at your next long rest you can heal a maximum of four hit dice. These two situations are basically then perfectly symmetric as far as long rests are concerned.
But short rests and homebrew also exist.
But you can also spend hit dice in short rests, even with this variant, and that puts the lie to the claim of “no difference.”
Also, even if you played with a variant of Slow Natural Healing that blocks using hit dice in short rests (!), some homebrew rules are affected by the fact that in 4E, there was a similar notion to hit dice called a healing surge, but those could be spent both inside of combat via your second wind and in/out of combat via healing magic. So you would have to also make sure that you are not using any of those rules, and that the only way to spend hit dice is long rests, to make it truly irrelevant. In every other case, there potentially is a real difference here.
So if you consider a short rest after this first long rest, in the HD-then-HP order you only have 2 hit dice to spend during the short rest, while in the HP-then-HD order you have 4 hit dice to spend. Consider a session with the following structure:
- Party enters The Forest, has some fights along the way, camps out outside of The Dungeon. Long rest.
- Party enters The Dungeon, has some fights along the way, camps out inside of the Dungeon. Short rest.
- Party faces off against the Big Bad, wins, gets The Thing, and escapes, camping out outside of the dungeon. Long rest.
- On their way back through The Forest, some Minor Goons try to waylay the party and steal The Thing. They are easily defeated and the party makes it back safely.
The key is that those extra 2 hit dice could make a life-or-death difference in facing the Big Bad, even if it's all the same when they get around to the Minor Goons. There are real circumstances in which those two hit dice can mean the difference between life and death for your character, because you might not get a long rest right before a boss fight.
The three tiers of being nice to your players
So there are three tiers of how nice you can be to your players. Here they are, in order from nicer-to-them to meaner-to-them:
- Players get hit dice first, and then hit points, but they do not have hit dice limits until the long rest is over. So, after The Forest those extra hit dice do not evaporate into the aether.
- Players get hit points first, and then hit dice. This gives them maximum healing ability during short rests.
- Players get hit dice first, and then hit points, having to respect the hit dice limits throughout.
I will say that for story reasons I prefer (1) and (3) over (2), because HP-then-HD has this really weird pathology where, in all of the cases where this matters, you can end up taking a long rest that is much less healing than a short rest which happened prior.
In fact if you think about what smart players would do in the case of (2) above, they should really just take a short rest immediately after their long rest to recover a few more HP before they head home. Strange, right?
Connection to bigger issues in the world
I have to mention that this is a special case of what in accounting is called a “cash flow” problem. The idea is that even if long-term your financial status is solid (i.e. you don't have a revenue problem), you could still run into short-term problems if you overextend yourself. So if we stipulate that on average you as a person will make a fixed amount of $1k/week, you still have a strong reason to prefer “I get paid for the next four weeks up-front” to “I get paid each week at the start of the week” to “I get paid each week at the end of the week” to “I get paid for all of it at the end of 4 weeks.” Yes, after 4 weeks the amount made in each of these 4 cases is exactly the same—but in each pair, there are some situations where your accounts run dry in the latter where you would not have gone broke in the former. It’s the same thing if you’re planning a big party (say, a wedding) that comes near what you can financially bear: you want to pay your vendors as late as they will let you, and you want to dig into emergency funds etc. as early as you can, so that you do not ever have trouble putting food on the table in your day-to-day life.
And managing a company’s financials is the same thing; you might have a bunch of invoices out that on paper mean that you have an extra million dollars in the bank and are very successful revenue-wise and profit-wise... but if your actual bank balance is hovering near zero because your clients are taking a while to pay those invoices to you, you nevertheless have a cash-flow problem on your hands. Because your employees do not want to hear “hey, uh, I can’t actually pay you the full amount this pay period, but we’re gonna work real hard to make sure that we can make it up to you by the next one”—like, that can be a fatal mistake to your company.