Please read this Game of Thrones Wikia passage first:
Dragon eggs are notoriously difficult to hatch, though they can maintain the spark of life inside of them for decades if not centuries. The secret key to hatching the eggs seems to involve some form of blood magic: as the House words of the Targaryens hint, it requires "fire and blood". To hatch them, dragon eggs must be burned in roaring flames, with which another creature is simultaneously being burned alive - a life in exchange for a life. In the wild this might just be a prey animal that the parent dragon kills, but human sacrifice will do the trick quite nicely, particularly if there is more than one egg to hatch.
And now the script relating to the dragon-hatching event in Season 1 Episode 10:
Rakharo: (picking up the dragon eggs from their chest, speaking in Dothraki) ls this your command, Khaleesi?
(Daenerys nods, Rakharo places the eggs next to Drogo’s funeral pyre)
Jorah: Drogo will have no use for dragon eggs in the Night Lands. Sell them. You can return to the Free Cities and live as a wealthy woman for all your days.
Daenerys: They were not given to me to sell.
Jorah: Khaleesi, my Queen, l vow to serve you, obey you, to die for you if need be, but let him go, Khaleesi. l know what you intend. Do not.
Daenerys: l must. You don't understand.
Jorah: Don't ask me to stand aside as you climb on that pyre. l won't watch you burn.
Daenerys: ls that what you fear? (kisses Jorah on the cheek, then speaks to the rest of the Dothraki and Lhazareen who stayed with her) You will be my khalasar. l see the faces of slaves. l free you. Take off your collars. Go if you wish, no one will stop you. But if you stay it will be as brothers and sisters, as husbands and wives.
Mirri Maz Duur is shown tied and bound by rope.
Daenerys: Ser Jorah, bind this woman to the pyre. You swore to obey me. (to the crowd) l am Daenerys Stormborn of House Targaryen of the blood of old Valyria. I am the Dragon’s daughter. And I swear to you that those who would harm you will die screaming.
Mirri Maz Duur: You will not hear me scream.
Daenerys: I will. But it is not your screams I want. Only your life.
Game of Thrones, Season 1 Episode 10, "Fire and Blood"
Daenerys seems to do exactly the things as required for the procedure of hatching dragon eggs, namely:
She asks Rakharo to place the dragon eggs on the pyre seemingly because "They were not given to me to sell". A point to be considered is that in the future episodes she does several things that are much below this like selling her dragon to Kraznys, stealing items from Qarth, etc.
She gives a human sacrifice (Mirri Maz Duur) as required. A point to be considered here is that Mirri Maz Duur was most probably directly responsible for the death of Khal Drogo in that unhonourable way and the death of her child, and she only says "But it is not your screams I want. Only your life."?
So did Daenerys know all this or was all this just a big coincidence? If she knew, then how?