One of the myths I hear quite often from both children and adults is that a when a dog wags his tail it means he's happy. Unfortunately this is a misconception that can be dangerous to someone who thinks it's safe to approach a dog simply because he's wagging his tail.
The truth is that a wagging tail by itself only tells us how excited or aroused a dog may be. To know whether is a dog is friendly, aggressive, or fixated or something behaviorists and trainers look at other parts of the dog.
Learning how to "read dog" is not an easy thing to do. Professionals go to seminars, read books, watch videos and observe dogs for months or even years before they feel comfortable enough to say they are good at reading canine body language. "Reading dog" consists of looking at the eyes, ears, mouth, facial expression, tail and body posture. What makes it even more difficult is that some body language is fleeting and you need to be very focused and observant if you are watching a dog who is overly excited or aroused since you can easily miss a split second change in expression. (People have this too -- called "micro-expression". This was first discovered by Dr. Paul Ekman and is the basis for the TV show Lie to Me.)
While I talk extensively to children about when it is safe and when it is dangerous to approach a dog, I talk very little about body language since it's difficult enough for a professional to learn how to read. One thing I do tell them is that you can't just look at a wagging tail to tell you if a dog is safe or not. A happy friendly dog wags not just his entire tail, but his body as well.
In the videos below I have examples of two different tail wags. The first video is of my dogs. They aren't overly excited, but their whole bodies move along with their tails. The second is of a dog who is overly aroused by the movement of the scooter going past. His body is stiff as he runs back and forth, and his tail is held high and wags stiffly as well. Which dog would you want to pet?