I've been in Dubai some time ago and in a Starbucks I've found square donuts.
Can you explain why? Is there a religious rule?
I think that is just for aesthetical reasons.
There are stores in Dubai that do sell round doughnuts, such as Dunkin Donuts, Krispy Kreme or other stores, the only reference to square doughnuts in Dubai that I could find was the ones at Starbucks.
Also on the other hand there are square doughnuts for instance in the US, without any mention to it be for any religious or cultural reason. According to this Time article, they started producing it for purely practical reasons: