##It was an intelligent guess, presumably made by Elrond during the Second Age
Since it was forged by Sauron in Orodruin itself, it was generally assumed that the One Ring could only be destroyed in the same fire that "created" it. Forging in a real world context literally involves the material to be melted (slightly) first, and then shaped into an object, which is in this case, a Ring. If the fires were hot enough to melt it the first time, it would definitely be hot enough to melt it again.
- The Elves knew that an all-powerful and all-dominant Ring was forged by Sauron in Mount Doom, thanks to Celebrimbor, who perceived Sauron when he first put on the Ring.
But the Elves were not so lightly to be caught. As soon as Sauron set the One Ring upon his finger they were aware of him; and they knew him, and perceived that he would be master of them, and of an that they wrought. Then in anger and fear they took off their rings.
The Silmarillion, Of the Rings of Power and the Third Age
- This information was very likely to have been relayed down to Galadriel and Gil-galad when Celebrimbor gave them the Elven Rings, and to Elrond and Cirdan when Gil-galad passed them his Rings.
What they didn't know was "how exactly to destroy it". Putting two-and-two together, they reckoned that the Ring could only be destroyed in the place it was made in.
-
'Alas! yes,' said Elrond. 'Isildur took it, as should not have been. It should have been cast then into Orodruin's fire nigh at hand where it was made. But few marked what Isildur did. He alone stood by his father in that last mortal contest; and by Gil-galad only Cirdan stood, and I. But Isildur would not listen to our counsel.
The Lord of the Rings: The Fellowship of the Ring, Book II, Chapter II, The Council of Elrond
The Ruling Ring passed out of the knowledge even of the Wise in that age; yet it was not unmade. For Isildur would not surrender it to Elrond and Círdan who stood by. They counselled him to cast it into the fire of Orodruin nigh at hand, in which it had been forged, so that it should perish, and the power of Sauron be for ever diminished, and he should remain only as a shadow of malice in the wilderness.
The Silmarillion, Of the Rings of Power and the Third Age
So when the time came to destroy the Ring in the Second Age, Elrond and Cirdan counselled Isildur to destroy it in the fires where it was forged.
And fast forward to the Third Age, Elrond merely repeated this information at the Council of Elrond.
Thereafter this so-called "information on how to destroy the Ring" was taken up by the Istari, who came only at around Third Age Year 1000-ish. Saruman, being a Maia of Aule himself, might have given his two-cents on how the Ring could be destroyed (when he was still "good"), but this cannot be confirmed.
As far as we know, as this is never discussed explicitly, it can be assumed as an intelligent guess.