My brother’s dog, Chloe, has been scratching herself crazy. He has a cone on her to prevent her from losing any more hair but it has been about two months that this has been going on. He has tried many over the counter things to treat whatever is going on to no avail. Chloe has lost pretty much all of her hair on her back side, butt and shaft of tail. There is two other dogs in the house that don’t have this issue.
While this may not be the case with your dog, hair loss around the tail is almost always related to fleas. There may even be a flea colony somewhere where your dog sleeps. Here is a tongue and cheek article about fleas, even if you don’t see any, they may still be present: https://www.vetbabble.com/dogs/health-dogs/dog-cat-may-fleas-even-never-see/
I would strongly encourage going to a vet so they can diagnose the underlying issue and recommend a the appropriate treatment. I cannot be certain if there are fleas and the hair loss could be from something else, but fleas are the first thing that typrically need to be excluded based on your description. Even if you are already using an over the counter flea treatment, the product a vet can prescribe will likely be more effective as they will have local knowledge about what works.
Other causes of hair loss could include allergies to the environment (which can include fleas), allergies to food or other metabolic conditions such as hypothyroidism that a veterinarian will also help you be able to diagnose and hopefully resolve.