I was researching this question earlier today, and the answer has two steps:
1. First you need to install Snow Leopard (10.6), which you buy on a disk. It’s $19.99 in the Apple Store right now.
2. Once you have installed Snow Leopard and run Software Update, you will be running MacOS X 10.6.8. It will include the Mac App Store, and you’ll be able to buy OS upgrades through there.
Two notes:
I haven’t verified that Lion and Mountain Lion (which are no longer the latest version of MacOS) are still offered in the Mac App Store; I’m still at step one. It’s possible that if you want Lion or Mountain Lion (not Mavericks) you might have to buy e.g. this item we’re commenting on, which eventually gets you a download code you can enter in the Mac App Store. A year ago when my mom wanted to upgrade to Lion (the furthest her MacBook can go) that’s how we had to do it. We bought Lion over the phone and they emailed the code.
Note that you should check how far your MacBook Pro should go. Search Google for things like “can I install Lion on my MacBook Pro” or “can I install Mavericks on my MacBook Pro” to find more tips for that. The very first MacBooks Pro were left behind several versions ago, but more recent ones can run Mavericks.