He took on the pop star Miley Cyrus when she commented on Instagram that she disagreed with his politics and those of his partner, Domenico Dolce. “We are Italian and we don’t care about politics and mostly neither about the American one!” he responded on Instagram in a later post. “We make dresses and if you think about doing politics with a post it’s simply ignorant. We don’t need your posts or comments so next time please ignore us!! #boycottdolcegabbana.”

Mr. Gabbana has called the singer Selena Gomez “ugly” and hit back at critics of a sneaker with the phrase “I’m thin & gorgeous” written on the side, posting, “Darling, you prefer to be fat and full of cholesterol??? I think u have a problem.”

Most of the posts with offending comments have since been taken down.

The fashion blogger Bryan Yambao, who blogs under the name BryanBoy and has over 600,000 Instagram followers, expressed skepticism about the brand’s claim that it was hacked — a sentiment echoed widely online.

“I am having a hard time believing the notion that both social media accounts were hacked, especially when Mr. Gabbana has a proven track record of trolling everyone under the sun, from celebrities like Lady Gaga and Selena Gomez to influencers like Chiara Ferragni, both on public feed posts or on comments,” he said in a message on Wednesday.

Dolce & Gabbana has been the subject of boycotts so often that the company makes T-shirts inviting people to “#Boycott Dolce & Gabbana,” with a red heart. It is listed for $295 on the company’s website.

Luxury brands have to be especially careful. They have poured into China in recent years, attracted by its stunning growth and its increasingly affluent population. In September, Tommy Hilfiger brought its #TommyNow extravaganza to Shanghai, and in December, Coach is planning its 15th anniversary pre-fall show in Shanghai’s picturesque Bund area, demonstrating that the brands want to cater increasingly to local tastes.

But a corruption crackdown under Xi Jinping, the Communist Party’s top leader, put a halt to conspicuous consumption, and the brands must remain wary of a yawning wealth gap that has developed in China.