Why is a dog afraid go outside especially in the dark?

Some dogs are just spooked like humans can get in the dark. Also, your dog may hear or smell something you can't see. I use a sensor light in the doggy run for my dogs and as soon as they go through the doorway to out into the doggy run the light automatically goes on. I also stand at the door until they do their business. Sometimes they'll bark while out there (could be a cat or a raccoon) and that's what dogs do. I give them the command to come in for fear of them waking up the neighbors. Try the sensor light and just stand at the door. A few times of this (leaving the door open if you can) and your dog will get over the habit.