A very common cause of hair loss in dogs is an infestation by parasites such as mites, lice, or fleas.
In particular, if your dog is losing hair around its neck and tail, there's a high chance it's due to fleas.
Over time, this can lead to hair loss as specific areas of skin are weakened and their coat is pulled out.