This depends. Legacy moves cannot be relearned, and you also cannot get the same move that was forgotten. So if you use it on a Steel Wing Dragonite, you will always get Dragon Tail. If you use it on a Dragon Breath Dragonite though, you may end up with either Steel Wing OR Dragon Tail. The same logic applies for charge moves, except there are more combinations and less certainty. If your Dragonite has Hyper Beam, then the TM will yield either Outrage or Hurricane. If it knows Dragon Pulse (legacy), it may end up learning Hyper Beam, Hurricane, OR Outrage.
Working of TMs?
When you use TM, are all moves included in the roll?
For eg: I got a fast TM today, and wanted to use it on my Dragonite with Steel Wing. I got Dragon Tail.
What I wanted to know is, when you use TM, is there a 1/2 chance of getting Dragon Tail? Or is it a 100% chance?
Similarly for Charged TM, I have a Jolteon with Discharge, and I want either of Thunderbolt or Thunder. Are the chances 1/2 or 1/3?
Answers
I could be wrong since I can only go from anecdotal evidence but I used a quick move TM on a SW/DC Dragonite and ended up with DT/DC.
Plus the wording when you use a TM was something along the lines of "the Pokemon will forget (current move) and learn a new move", though I don't remember exactly - so it would seem from the way it's worded it can't reroll the same move.
With the update being so recent it might take a while to get enough data on move rerolls, so just be patient.