What kind of long crawly looking thing would come out of a dog's skin and surface in the hair?

Without more info, my first thought was a Tick. Absolutely disgusting things but they are not, in my mind anyway, LONG. Round and fat, gray in color, they kinda look like a sick pea ( light grey instead of green ) I would catch the thing, put it in a bottle or jar and take it to the vet! With out more details,and assuming that this is perhaps some type of insect larva imbedded into the skin from fly's or wasps. If it is a whiteish colored it is some type of larva. Maybe some kind of worm, perhaps maybe a tapeworm, hookworm or another parasite, I wouldn't touch it directly if I were you. i.e: Hookworms (Uncinaria, Ancylostoma spp.) can infect our pets at any age but are particularly life-threatening to the very young. Hookworms latch onto the intestinal wall and live on blood, contributing to signs of anemia, weakness, wasting and bloody diarrhea. The nursing young may die due to blood loss and shock with heavy infections. Natural infections occur through eating contaminated soil, or by infective larvae burrowing into the skin of the paw, or through the milk of an infected mother. Human infection may occur when the larvae in contaminated soil penetrate the skin. "Cutaneous Larva Migrans" or "Creeping Eruption" is extremely irritating. Whipworm infection (Trichuriasis) is contracted by direct ingestion of eggs in contaminated food or soil. All ages may be easily affected with the cardinal signs being poor condition or performance. Whipworm eggs are remarkably durable and although they may take up to eight weeks to reach the infective stage, they can resist freezing and remain alive in the environment for years. Adult tapeworms (Dipylidium, Taenia, Echinococcus spp.) are found anchored to the wall of the small intestine by hooks or suckers. These parasites use an intermediate host (a "middleman") for part of its development. The final host (cat) then eats the contaminated prey and the tapeworm then is able to complete its life cycle. With Dipylidium spp., cats become infected when they ingest fleas or biting lice carrying the larval form of the tapeworm. This tapeworm requires only two to three weeks to develop to an adult so unless fleas and lice are quickly brought under control, re-infection occurs rapidly. Taenia spp. use a variety of small rodents and rabbits as their intermediate hosts. Cats become infected when they hunt these vertebrates. Animals do not develop resistance to tapeworms and are readily reinfected. The worms shed segments intermittently and may be found in the feces, in the fur or even on furniture, carpets, or clothing. Although rare in North America, Echinococcus tapeworms can infect humans and cause a variety of chronic and debilitating diseases. Hope this helps.