Investing in dividend growth stocks has proven to be a great long-term strategy for investors. The longer you hold on to a stock, the larger your payouts may end up being. Dividend Kings have that designation because they managed to raise their payouts annually for at least 50 consecutive years. They are seen by many as some of the safest income-generating investments to own. 

But the past doesn't necessarily predict the future when it comes to investing. What were safe investments for years may not remain that way.

A couple of Dividend Kings that investors may want to think twice about investing in right now are 3M (MMM 0.46%) and Johnson & Johnson (JNJ -0.46%). Both of these companies face some lofty legal bills and challenges, and investors should be careful when buying these stocks just for their payouts. Here's why these are two stocks you can't simply buy and forget about anymore. 

1. 3M

Share prices of 3M rose this week as the company told investors that it agreed to a settlement involving roughly 260,000 lawsuits related to faulty earplugs in manufactured for the U.S. military. Under the agreement, 3M will pay out $6 billion over the next five years. The total is much lower than the $10 billion some analysts were expecting the plaintiffs to settle for.

But the legal risks 3M faces didn't end with this settlement. The company's legal team is still fighting claims relating to the contamination of multiple municipal drinking water systems in the U.S. contaminated by "forever chemicals." 3M reached a tentative agreement to settle those claims for $10.3 billion, but some states are trying to block the settlement, arguing that the payout is insufficient. 

Even if the settlement does get finalized, these two deals will result in some incredibly significant costs for 3M over the next several years. That could put pressure on an already expensive dividend. Last year, the company generated free cash flow of $3.8 billion and it paid out $3.4 billion in dividends. Having to spend more on legal fees and settlements will put the business in an even worse position with respect to free cash flow.

3M's stock price is down around 50% over the past five years, which has helped push its dividend yield up to 6%. Although 3M raised its payouts annually for 60-plus consecutive years, I'm not confident in its ability to continue to keep raising it. Even if it can manage these current legal battles, the business doesn't appear to be as strong as it used to be.

Investors should tread carefully with 3M's stock as this dividend stock is making for some very uncomfortable shareholders right now.

2. Johnson & Johnson

A company with potentially even larger problems than 3M is Johnson & Johnson. Plaintiffs are suing the healthcare giant over claims that using its talc-based products resulted in them developing cancer because of asbestos contamination. J&J has won some of the lawsuits but it has lost several as well and some of the settlements have been costly. In 2020, a court awarded 22 plaintiffs $2.1 billion in damages, and that was down from an original jury-determined damage award of nearly $4.7 billion.

Not all cases will be that costly, but it's an indication of just how significant the risk is for Johnson & Johnson. There are more than 60,000 lawsuits still outstanding. In an effort to limit its risk, the company attempted to put control of the faulty products (and its liabilities) into a subsidiary and then have the subsidiary file for bankruptcy protection. That strategy has failed twice in court, with judges saying that the subsidiary isn't in "immediate financial distress" and is ineligible for the protection filing.

Johnson & Johnson has a tentative settlement in the works that involves plans to pay $8.9 billion. But without the courts' willingness to go along with its plans, the claims remain unresolved. The expenses could be significant for Johnson & Johnson if it isn't able to reach a settlement as it could easily incur costs totaling tens of billions of dollars, especially when legal fees get added in. 

Despite the legal risks its facing, the healthcare stock has made for a relatively stable investment. The stock price is up 22% over the past five years. J&J's dividend yield of 2.9% is not nearly as high as 3M's, but it could also be in jeopardy if Johnson & Johnson's legal bills start to mount.

For now, this is still a relatively safe dividend stock with the company generating $17.2 billion in free cash last year while paying out just $11.7 billion in dividends. But given the lawsuits Johnson & Johnson faces, investors should be careful not to assume that it will stay a safe investment forever. As long as you're willing to keep close tabs on the business and its risks, this can be a decent dividend stock to own -- but it's not one you can just buy and forget about.