Targaryens are not immune to fire or dragonfire.
Dany's first time not being burned by fire was a magical event caused by blood magic and the birth of the dragons.
The second time she wasn't burned was a show only creation that didn't have an explanation.
But we've seen Jon and Viserys from Game of Thrones suffer burns, and Laena (who is half Targaryen) burned by dragonfire. Daemon has burn scars on his body and both of his parents and grandparents were Targaryen siblings. Dany herself suffers burns in the books as well.
“TARGARYENS ARE NOT IMMUNE TO FIRE! The birth of Dany’s dragons was unique, magical, wonderous, 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.”
-GRRM
Game of Thrones deviated from the books to give Daenerys Targaryen a supernatural immunity to fire. Don't count on it extending to the rest of her family.
winteriscoming.net