Gold is priced in US dollars around the world. If the dollar rises, a buyer paying in euros, rupees or dirhams needs more of their own money for the same ounce, unless their currency is tied to the dollar. Fewer buyers usually means a lower price.
A weaker dollar works the other way. Gold gets cheaper for most of the world and demand tends to pick up.
A note for the Gulf
The UAE dirham, Saudi riyal, Qatari riyal, Omani rial and Bahraini dinar are pegged to the dollar. So for buyers in those countries, the local price of gold moves almost exactly with the dollar price.
It is not a law
Gold and the dollar can rise together, especially when the whole world is scared and buying both for safety. Treat the link as a strong habit, not a rule.