You need to see the vet. That's usually nerve damage for some reason. You need to diagnose what the problem actually is. Could be many things but some possibilities are spinal/neurological problem (many possibilities), broken bone or if someone other than a vet gave your dog an injection lately. It needs diagnosis and treatment.