A high-yielding dividend stock can be attractive in today's bear market. With the stock market in the doldrums, a hefty but safe dividend yield can offset some of the potential loss in wealth appreciation -- plus, it can mean you're generating some recurring dividend income. At around 5%, Walgreens Boots Alliance (WBA 2.63%) pays a significantly high yield when you consider the S&P 500 average is less than 1.8%. The stock's 26% decline this year has pushed its yield higher, likely putting it on the radar of many potential income investors.

But is investing in Walgreens for the dividend a safe decision for investors, or would it be a move that could cause more harm than good?

The company's margins remain low

One thing income investors need to be aware of with Walgreens is that the pharmacy retailer doesn't generate high margins. While there has been some volatility in the past few years due to the pandemic, over a 10-year period, the healthcare company has averaged a profit margin of just 3%.

WBA Profit Margin (Quarterly) Chart
Data by YCharts.

Low margins can work for businesses that sell lots of products and have strong demand, but they also mean less of a buffer in the event something goes wrong or the company struggles. And that strategy has been working just fine for Walgreens, as the company has paid a dividend for around 90 consecutive years, and this year also marked the 47th straight year that the business hiked its payouts.

But forward-thinking investors know that doesn't necessarily mean the dividend will always remain safe.

Cash flow is something investors need to monitor

The biggest risk to the dividend today is undoubtedly the company's expansion into healthcare, which could prove to be a make-or-break strategy. Walgreens has been diverting billions into launching primary care practices at its locations, and that could be the start of more spending down the road. It could potentially lead to some difficult decisions between balancing growth objectives and paying dividends -- especially if its margins don't improve.

The following chart looks at how much free cash flow the company has generated after factoring in its dividend payments. 

Fundamental Chart Chart
Data by YCharts.

The situation has recently deteriorated to the worst level it has been at in the past decade. Investing in primary care may strain the business and make these numbers look worse in the future.

Can you rely on Walgreens' dividend?

Walgreens' yield looks great on paper, but it's not one I would advise risk-averse investors to add to their portfolios. There's a lot of uncertainty around Walgreens' business as it expands into primary care. It could be a rough ride that potentially leads to smaller dividend increases in the future, and in the worst-case scenario, a reduction to the payout. Due to that uncertainty, I would suggest dividend-oriented investors consider safer income stocks than Walgreens.