How do you mean extract? you mean, there is a map with a texture you want, but you can't find a download for it? In that case, you can get it without asking the author of the map or trying harder to find it. If the author hasn't released the texture to the public to use, then you can go around taking it from a map (1. that's wrong 2. it is impossible). If it is your map and your texture and you lost it, you should really back-up your stuff...
EDIT: one more thing, Hammer doesn't pack custom files into a bsp. you have to do that manually with something like pakrat or PackBSP