Pegged currencies can be unpegged at any time. And sometimes those are interesting bets. Ask George Soros.
....But, one again, I feel compelled to counter a fallacy. If you have purchased stocks using U.S. dollars, you are not holding U.S. dollars. You are holding shares of stocks, and those companies can do business in any currencies. For example, if you buy shares of McDonalds on the New York Stock Exchange, you're buying a company that does two thirds of its business in non-U.S. dollar countries, spending and receiving currencies other than U.S. dollars. The currency zone where the stock is traded, and the currency you use to buy the stock
doesn't matter if your aim is to hold that currency, or strong correlates with that currency. You own a stock (a fraction of a company), not a currency.
You can purchase McDonalds stock using South African rand if you want. (You simply convert them to whatever currency the stock exchange wants, just before you buy the stock.) And you can calculate the share price of McDonalds at any moments in time in Japanese yen. Any convertible currency works for these purposes. But that doesn't mean you're holding rand or yen either. These are just momentary ways of valuing something else, McDonalds stock, that isn't any currency itself.
As another way to think of this, let's suppose you grow wheat. You use all your wheat to buy rice. Does this mean you're holding wheat, because that's what you used to buy the rice? No! You're holding rice! You
traded all your wheat, at a particular moment in time, for some quantity of rice. Now, it just so happens that rice is an imperfect substitute for wheat, so the spot price of rice might be correlated to wheat's price to some degree, moving together to some extent. But you don't own wheat.
The only way to hold U.S. dollars is to hold U.S. dollars, and the only way to hold Hong Kong dollars is to hold Hong Kong dollars. You're not holding the currencies if you merely used those currencies to buy something else. OK, yes, you can trade U.S. dollars for U.S. T-Bills, which are extremely cash-like (short term U.S. government bonds). Most people would consider holding U.S. T-Bills to be "holding U.S. dollars" -- that's "close enough." But shares of stock, no.