The answer to your question depends on the cause of your leg length difference. If it’s from a shortened, overworked muscle then exercises to stretch that muscle out might restore your full length.
If it’s a true leg length difference (the bones are shorter on one side), then a shoe insert or shoe lift can level your pelvis and spine. Symmetry is important to prevent future back pain or other problems.
Small leg length differences don’t require much more than that. Surgery is only done for severe cases of shortening.