By Caitlin Ostroff

The dollar is having a bad year, but some emerging markets' currencies have it worse, with no reprieve in sight.

The Brazilian real, the South African rand and the Turkish lira have lost about 20% of their value against the dollar this year, putting the former two on course for their biggest annual declines since 2015. The Russian ruble and the Mexican peso have dropped roughly 15%.

The rout has occurred despite the dollar's slide against major world currencies to its weakest level in over two years.

Investors remain wary of stuttering economic growth and high levels of coronavirus infections in poorer countries, where the pandemic has exacerbated existing problems such as underfunded health systems and strained government finances. Fund managers pulled billions of dollars from their stock and bond markets in March and April, sending currencies plummeting, and are yet to return most of that money.

Sudden and sharp currency depreciation, if unchecked, poses a grave threat to these economies: It can lead to runaway inflation levels by driving up the cost of both imports and payments on foreign debt, while eroding the value of savings and financial assets, leaving domestic consumers with little purchasing power. Concerns that a central bank is unable to stem a currency's decline could prompt a further exodus of foreign investors and creditors, exacerbating a nation's financial woes.

The developing nations' currencies won't recover until there is a rebound in demand for raw materials that they export, such as oil and copper, analysts said. Brent crude, the international benchmark for oil, has climbed almost threefold from its April low, but global demand for energy is forecast to contract sharply this year. Questions about the pace and strength of the economic recovery are also keeping a lid on prices of industrial metals such as copper and other raw materials.

"What emerging markets are going to need are real signs that the global economy has healed," said Mark McCormick, global head of foreign-exchange strategy at TD Securities. "They need that return to normal growth; they also need that pickup in commodity demand."

The pandemic has sent the global economy into its deepest recession since World War II. Emerging markets and developing economies are likely to shrink 2.5% this year, according to World Bank estimates in June, marking the first contraction for the group as a whole in at least 60 years.

Brazil, India, Russia and South Africa are among the five nations with the most coronavirus cases, along with the U.S., according to data compiled by Johns Hopkins University.

In Brazil, where the death toll from Covid-19 has passed 100,000, the government has boosted spending to aid businesses and the unemployed. That has put extra pressure on an already gaping budget deficit. The real has dropped 27% this year against the dollar.

Investors are worried that the government will struggle to rein in spending and take on unsustainable debt levels, said Ilan Solot, global currency strategist at Brown Brothers Harriman.

"That's going to come back to bite them at some point in the future," Mr. Solot said. "We're going to have a lot more to worry about when the bill comes for a lot of these countries."

Uncertainty around how emerging markets will combat the virus and how successful those strategies will be has prompted investors to pull out. In March, foreign investors withdrew about $77 billion from bonds and stocks in such nations, excluding China, according to the Institute of International Finance, an association of global financial firms. Through June, about $23 billion had returned.

"The longer the outbreaks go on, the longer it's going to be for markets to be more comfortable with risk" when it comes to investing in Brazil, Russia, South Africa or Mexico, said Simon Harvey, currency analyst at broker Monex Europe. "You've still got a lot of risk hovering around these markets."

To keep rising infections from overwhelming hospital capacity, South Africa has kept a strict lockdown in place, with travel between regions banned. The stringent restrictions are likely to see the economy contracting 11% this year, making it one of the hardest-hit emerging markets, analysts said.

That has sent the rand down by almost a fifth of its value against the dollar so far in 2020. Investors withdrew more than $3 billion from South Africa's bond market and almost $4 billion from its stock market by the end of July.

A drop in market volatility and the prevalence of low real yields because of interest-rate cuts could encourage investors to return to emerging-market assets, Mr. Harvey said, adding that is unlikely before the first half of next year.

Meanwhile, a number of developing countries including Mexico, Turkey and India have slashed interest rates to bolster the flow of credit and boost their economies. That is only making their assets less attractive to investors, as lower rates threaten to stoke inflation, and the returns are no longer enough to compensate for the higher risks tied to those assets.

Lower interest-rate differentials with the developed world also make those emerging-market currencies less attractive for investors looking at carry trades: That is where investors buy low-yield currencies such as dollars, euros or yen to invest in high-yielding currencies to profit from the difference.

Some, such as Turkey, have also burned through their foreign-exchange reserves in a bid to support their currency, leaving their central banks with little room to maneuver if the currency slide continues. The Turkish lira is down 19% this year against the dollar, on track for its worst year since 2018.

Looking ahead, spending by emerging-market governments as a percentage of their gross domestic product is also a fraction of the value of stimulus measures deployed in the U.S. and Europe, Mr. Harvey said. That is putting developing nations on a very different recovery track from that of developed markets.

With the outlook for the global economy and financial markets remaining uncertain, many investors are content with dipping into stocks closer to home. The main U.S. equity benchmarks have erased their losses from earlier this year and are on track to hit record highs.

"In a world where the S&P 500 and the Nasdaq are doing so well, there's not a rush to capitalize on emerging markets," Mr. Solot said.

Write to Caitlin Ostroff at caitlin.ostroff@wsj.com