Installing a coat hook on a door is a pretty basic job. With a coat hook, people can really load them up with lots of coats and the weight can pull them out of a door, particularly a hollow core door. Coat hooks are great for the back of a bathroom door where you can hang a bathrobe on them.
The danger of hanging a hook on the back of a hollow core door is that there really isn’t much support there and you risk the hook pulling out and damaging the door. You can try hollow wall anchors, but there are no guarantees here.
For solid doors, you can find the center of the door and predrill holes for the screws. Obviously you want to use screws that are short enough so they won’t penetrate the other side of the door, but large enough so that they will support weight.
For wall installations, it’s the same deal. Ideally you want to find the wall studs and use screws that will penetrate them by 3/4 of an inch. If you want a location that doesn’t have a stud directly behind it, use hollow wall anchors or molly bolts. You want to be able to hang things on the hook, but you don’t want to pull the hook out of the surface.