Targaryens are not immune to fire. What happened to Daenerys on the funeral pyre was a one-time event (or rather two-time - recall episode 4 of season 6), according to the author, who's discussed it at fan events. So Daenerys herself isn't immune to fire either (and the thing with the eggs, where she isn't burned, IS NOT in the books). Plenty of Targaryens have been killed because of fire or extreme heat: Viserys, Aerion Brightflame who drank wildfire, Aegon V and his son Prince Duncan who died in a fire at Summerhall, and Rhaenyra Targaryen who was fed to her brother's dragon. So it's not that Viserys should have been fireproof, it's that NO Targ is inherently fireproof.