As usual, we have to remember that there is a distinct and separate book canon and a distinct and separate TV canon. The two stories take place in distinct fictional universes and, although the TV show draws on the book storyline, it is not the same story and can differ from it, sometimes subtly and sometimes quite wildly. What is canon in the books may have no bearing on the TV show and vice versa.
In the book canon
In the Song of Ice and Fire novels, the Targaryens are not immune to fire as a matter of course. Long exposure to living in a land dominated by volcanic activity, with the city of Valyria itself built around rivers of lava, may have given the Valyrians - including the Targaryens - a very moderate, increased resistance to heat. But that's all. The difference is not massive. As George R.R. Martin says:
"It gives me a chance to clear up a common misconception. TARGARYENS ARE NOT IMMUNE TO FIRE! The birth of Dany's dragons was unique, magical, wondrous, a miracle. She is called The Unburnt because she walked into the flames and lived. But her brother sure as hell wasn't immune to that molten gold."
"So she won't be able to do it again?"
"Lastly, some fans are reading too much into the scene in GAME OF THRONES where the dragons are born -- which is to say, it was never the case that all Targaryens are immune to all fire at all times."
We see ourselves that Viserys was not immune to the molten heat of the pot of gold dumped over his head by Khal Drogo in Vaes Dothrak, and during the Dance of Dragons several Targaryens burned to death in dragonback battles.
So the question arises, how did Daenerys survive the funeral pyre in Lhazar at the end of A Game of Thrones? The simple answer is magic. Mirri Maz Duur had already used magic to save Khal Drogo's life (if only as a vegetable), drawing from the life of Daenerys's unborn child. When Daenerys burned Mirri Maz Duur alive on the funeral pyre, along with Drogo's body and the three dragon eggs, it created a magical catalyst that allowed the dragon eggs to hatch (the lack of blood sacrifice may be why the previous Targaryen eggs had not hatched, although this doesn't explain the failure at Summerhall where many lives were lost trying to hatch eggs). It might be that just killing Duur with the eggs and fire present was enough, or that Daenerys's act of faith (stepping into the flames) furthered things along, or the magical influence of the comet may have helped. An additional theory is that Mirri Maz Duur herself was in the middle of trying to work some black magic to try to escape and this backfired and allowed the eggs to hatch and Daenerys to emerge unharmed.
George's commentary on the matter is clear: this was a one-off, magical event that will probably never happen again, unless similar circumstances arise.
Some readers dispute this, pointing out that Daenerys survives the conflagration in Daznak's Pit at the end of A Dance with Dragons. This is true, but Daenerys is wounded during the incident, suffering blisters and pain from the heat. Daenerys got lucky (or Drogon was careful not to hurt her), avoiding the flames directly but still suffering after-effects.
So the answer to this question is clear: in the books Daenerys is not immune to fire at all times and can still be harmed by it.
In the TV canon
The TV series Game of Thrones leaves considerably less room to argue. In the first episode of the series, Winter is Coming, Daenerys gets into a scalding-hot bath and doesn't bat an eyelid. In A Golden Crown she picks up one of her dragon eggs after placing it in a brazier for several minutes and is unharmed. When her handmaid Irri touches the same egg, she burns her hands. In Valar Morghulis Daenerys is chained up whilst her dragons breath fire around her to kill the warlock Pyat Pree. The warlock is incinerated but Daenerys is completely unfazed by it.
Finally, in this week's episode Daenerys overturns four braziers in the Temple of the Dhosh Khaleen in Vaes Dothrak and burns the temple to the ground whilst she is standing in the middle of it. Afterwards she walks out completely unharmed, having apparently made the conscious decision to use her flame-immunity to cow the Dothraki into following her.
The Inside the Episode video that HBO posts for each episode is also fairly clear on the matter: this is an ability that Daenerys has at all times. So again the answer is clear: in the TV series Daenerys is immune to fire at all times and cannot be harmed by it.
The question of "Why?" is an interesting one. Viserys clearly was not immune to fire when he was killed in A Golden Crown. It may be something in the consistency of the molten gold that allowed it to kill him, but more likely the immunity to fire is something unique to Daenerys. If you believe that she is the Prince Who Was Promised rather than Jon Snow (or if they both are, somehow), it may have something more to do with that. It will be interesting to see if the show expands on this or leaves it more open to interpretation.
The next question is "How will this go down in the books?" We'll have to wait for The Winds of Winter to find out, but the situation in the books is already different: Daenerys had Drogon by her side when the Dothraki arrived, so the situation will play out in a different manner.