While the overall market may look a bit ugly, it's also presenting some great opportunities to buy otherwise great stocks on the dip.

Take Alphabet (GOOG 9.31%) (GOOGL 9.40%) and MercadoLibre (MELI 1.54%), for example. These two companies are some of the most dominant in their respective industries, yet they are trading at historically low valuations. These stocks are down significantly from their all-time highs, and if investors can muster up the courage to buy in this market, the stocks will reward them over the next three to five years.

1. Alphabet

Alphabet is the parent company of Google, YouTube, Google Cloud, and Android. However, the business is levered to one industry in particular: advertising. Advertising budgets tend to get squeezed during difficult economic periods, which could cause Alphabet's revenue to fall. Investors have recently demonstrated concerns about a recession affecting Alphabet, driving the stock price down around 22.5% from its all-time high.

Person at a desk with a stock graph on their computer.

Image source: Getty Images.

This fear came to fruition after Snap warned its investors about falling ad revenue due to macro pressures. As a result, Alphabet shares fell 5% the next day but rebounded by the end of the week. While investors may be a bit more worried about Alphabet, they shouldn't apply Snap's guidance to Alphabet for several reasons.

First, Alphabet's primary advertising platforms, Google and YouTube, are best in class, whereas Snap's isn't. Second, Alphabet's management is much more experienced. Google has been around since 1998 and YouTube emerged in 2005 and both have navigated recessionary environments, whereas Snap, which was founded in 2011, really hasn't. Finally, Alphabet is more diversified than Snap, with other divisions to keep the company growing even if ad revenue drops.

Even with these considerations, Alphabet's valuation has reached a bargain of 20 times earnings. For reference, the S&P 500 as a whole trades for 21 times earnings. This valuation means one of the most successful and dominant companies in the market is trading for less than the market average.

This fact alone makes Alphabet a top buying opportunity.

In addition, during the first quarter, Alphabet grew its overall revenue by 23% year over year with an operating margin of 30%. This is impressive, but it also reveals some cushioning as Alphabet can absorb some margin pressures without affecting the business too much. Furthermore, Alphabet has authorized a $70 billion stock repurchase plan to reduce its shares outstanding by nearly 5%.

All these catalysts would usually send Alphabet's stock soaring higher, but with recession fears looming, Alphabet is down. Now is an excellent opportunity for long-term investors to buy the dip in Alphabet's stock price and profit significantly over the next several years.

2. MercadoLibre

Many recession fears are focused on the U.S. economy. I guess it's a good thing MercadoLibre is based in Latin America. Still, that hasn't stopped the market from valuing it at its lowest point since the Great Recession in 2008-2009. Without any context, if I told you that snippet of information, you might think MercadoLibre's business is struggling. However, that's far from the case.

MELI PS Ratio Chart

MELI PS Ratio data by YCharts

During the first quarter, MeracdoLibre grew revenue 67% year over year to $2.2 billion. This marks a deceleration from 2021's 158% clip, but it's still impressive.

MercadoLibre is the e-commerce market leader in Latin America, serving 18 countries with its online marketplace and digital payments platform. Commerce drove a lot of the business gains during the pandemic, but the company is coming up against tough comparisons now that many in-person shopping options have reopened. Still, this segment's revenue, which includes its online marketplace and shipping logistics division, rose 44% in the quarter.

MercadoLibre's fintech division had an excellent quarter, with revenue rising 113% year over year. Although it is much smaller than its mobile payment platform, its consumer credit division boosted MercadoLibre's take rate, which increased the segment's profitability.

One mark against MercadoLibre is its low profitability, as it only reported a 6.2% operating margin and a 2.9% net income margin. However, it is still expanding significantly in its market. According to Statista, only 4.9% of retail sales occur online across Latin America versus 16.1% in the U.S.

With a substantial available market opportunity (which MercadoLibre is quickly capturing) and a low valuation, MeracdoLibre is as close to a no-brainer in today's market as I can find. Investors will be rewarded for this great business in a few years and can purchase the stock at a nearly 60% discount from its all-time high.

Bear markets can be scary, but they can also be a time full of opportunity. The purchases made during these next few critical months can define portfolio performance for years to come. Alphabet and MercadoLibre are two great stocks to grab to set investors up for success.