Sore back and leg feels better only after workout. Why is that happening?

Yes It Can. This pain in the distribution as you suggested is the result of an irritated nerve or facet joints or other injury typically in the lumbar spine (low back) which are caused by herniated disks, spinal stenosis or degenerative disc disease, etc requiring further evaluation by a spine specialist and may be candidate for facet injections/radiofrequency ablation and epidural steroid injection.
Loose. Warms up musscles and reduces stiffness.