While it may be tempting to allow your dog off it's leash because you assume you're in the middle of no where, consider this. While some trails may seem sparsly used chances are you are within a mile or two of another human, if that. It's always essential to have a perfect recall if you allow your dog off lead. Even if your dog isn't aggressive, someone elses might be, and you should be able to control your dog if it's faced with anything that could turn dangerous. There are also people who enjoy hiking but are terrified of dogs, and of course there are jerks as well who wouldn't mind causing harm to you or your pet. I am not saying keep your dog on it's leash at all times, that could become dangerous in itself. But rather you need to have your dog under your control at all times, if it's not you're leaving it up to someone else and not everyone will be so nice.
Humans shouldn't be the only concern. Throughout most of the United States there are coyotes, in the east coyotes are known to lure domestic canines into an ambush. Of course your dog wont have much chance of surviving an attack of upto 12 coyotes. Most other wildlife will be more afraid of your dog and run.
As mentioned above a perfect recall is very important. There are many ways to teach this to your dog, check cords, shock collars, clickers, or the timeless command and reward. I am not going to tell you which to use, because everyone has their own style.
Below are some videos on various ways to teach your dog or puppy to come.
(I have no affiliation with the people in these videos.)
And remember if you dont know if your dog will come, keep it on a leash while training, or at least in a secure area.
Spring loaded recall(puppy)
Name Game Recall
Random Reward Recall
Steve Austin's Recall
Basic long Line Recall
Focus and ignoring training(puppy)
Heel can be a useful command when used along with a recall. If you prefer your dog offleash, a heel would keep your dog close while another hiker passes you, thus keeping your dog out of the other hikers way. Again there are many ways to teach your dog, do whatever works best for you and your dog, just keep it humane.Below are some more hopefully helpful videos on training.
Begining of heel training
Adam Stone heel training
Clicker training heel and sit
Various videos from training classes
Trail Experiences And Etiquette
Depending on the trail you choose to hike on you will find various opsticles. Along the appalachian trail you can find anything from a downed tree to a stile. Your dog likely wont have an issue with the tree, but the stile could pose a problem. Before you decide to hit the trail it might be a good idea to get your dog comfortable on foreign objects. A small wooden step ladder can be used for stile training.
Another thing to keep in mine is; everytime you hit the trail with your dog you represent the canine hiking community. If you leave a bad impression it will be held against all the other dogs on the trail, regardless about how the other dogs act.
Most people dont agree with dogs in a shelter/lean-to/cabin/hut unless they are traveling with that dog, and even then they sometimes dont like it. be courteous, it's probly best to leave the mice and set up camp away from said establishments.