The answer to your first question is that we simply do not know. No explanation has been given for her apparent resistance to fire. We do know that this is not an ability imparted on all Targaryens, as both Jon and Viserys are affected by heat.
As for the line "fire cannot kill a dragon," this is misinterpreted to mean "fire cannot kill a Targaryen," adding to the confusion about Daenerys' fire resistance. This is not commentary on her own ability. Instead, she is refuting Viserys' previous claims to be "the dragon" -
No! You cannot touch me! I am the dragon! I am the dragon! I want my crown! Ahh!
Viserys also previously used the phrase "wake the dragon" when threatening Daenerys. At first she is frightened of him, but comes to recognize his weakness over time. When she says he wasn't a dragon, she is accepting that her brother was never what she thought he was.