The leg press and barbell squat go together because they are both exercises that recruit the large muscle groups in your legs. Squats have more of an all-body benefit because you use your back and core muscles. But both the squat and leg press are functional exercises that will help you in your regular life outside the gym.
The leg press, though, is not a secret formula for squat success. You should look at it as something that will supplement your squats, not take the place of them. When you are starting out, or if you have an injury that prevents you from doing barbell squats, the leg press is a fantastic substitute that places no pressure on your neck, spine, or arms. Many squat machines will let you do standing calf raises or donkey squats, too, with special attachments. Any machine that gives you that much versatility is a good thing.
One word of caution: if you are doing squats and leg presses on the same day, within the same routine, do not max out on each machine. Doing so is a fast track too injury, including spine and joint damage. If you want to see how much you can squat–and you have a friend who is willing to act as a spotter–do that on a dedicated day, where you will be leaving your leg and back muscles alone otherwise.