This sounds an awful lot like The Neverending Story. http://www.imdb.com/title/tt0088323/The boy takes a book from an old man at a shop and then reads the story and finds out he is affecting the story and connected to it. There is a Luck Dragon but no guns and it is not a tv show but a movie made in the 80's. So if it's not right please try to add some details with a few more differences.
Edit: It looks like there was a live action TV show as well. http://en.wikipedia.org/wiki/Tales_from_the_Neverending_Story It was filmed in 2000 and matches everything except I'm not sure of the guns.