HKD is usually accepted in Macau but any change which you might get would be in the Macanese currency.
Macanese Pataca, on the other hand, isn't accepted in Hong Kong.
This is based on my personal experience and experience of the people I know.
YMMV
travel.stackexchange.com/users/99281/gosnod
SHENZEN (CN)
In Shenzen almost always not - especially if you get further away from the border area.
you might get lucky with some random person or HK owner of some venue - but don't count on it.
( Sidenote - It is also illegal in China as far as I know to pay / accept in other currencies other then CNY except business that have special permit which is also probably the reason most people will not consider it but
for example a hotel might change for you )
You also mentioned Guangzhou in your question and the answer there is generally even less chance then Shenzen.
MACAU (MO)
In Macau it is a different story and the answer is mostly yes .
Taxi drivers / Restaurants / Hotels / Casinos / Ferry terminal will accept HKD - even 7/11 type shops and supermarkets will usually accept it at a ratio of 1/1 while giving you the change in Pataca ( MOP ).
Personally I never had a refusal ( been there tens if not hundreds of times )
Many ATM's ( most to my experience ) will even also disperse HKD if you choose so.
Not only that - but like @Aaron comment above - some Casinos ( and machines inside ) for example will not even accept MOP but only HKD ( or RMB ) .
you will still be able to change at the cashier probably.
If you do not want the hassle Of changing currency and you are there for a short time ( one-two days ) you can do fine with HKD especially in the tourist route.
( Sidenote II: less frequently but also possible in many places to pay directly in RMB if you come from China.
You will lose some conversion rate but then again you lose it when changing currency in advance too
so it all depends on the amount you are planning on spending )
Using MOP outside of Macau:
As for the other way
around - No, the MOP is quit useless anywhere outside Macau - and the further you get from the border the harder
it is to even change it back although I have seen some very rare exceptions where vendors in Zuhai ( near the crossings ) will accept it.
RMB in HK RMB in Hong kong is not generally accepted in normal venues, but it is sometimes accepted in tourist locations (especially Chinese-facing and also close to border ) even in big stores / malls but not everywhere
and it is up to the store / vendor to decide.
In that case also the change will be in HKD usually.
Many locations that accept RMB will have some kind of a sign near the cash register ( some even with exchange rates ).
I have already paid taxis in RMB , train tickets, ferry, supermarket and even MTR and cinema tickets.
But in most cases it will depend on the person / venue accepting it.
It is not "institutionalized" and deep like HKD in Macau.
While In HK use HKD .
All the above based on personal experience.
travel.stackexchange.com/users/42296/Obmerk Kronen
HKD in Shenzhen is basically a no go.
You may find the occasional person or merchant to take HKD, but the exchange rate will be atrocious.
You will be much better off getting cash from an ATM.
travel.stackexchange.com/users/13971/Hilmar
Also wanted to mention that many places in Macau also let you spend RMB (as well as newer-HKD).
Most shops charge the same price for all the currencies though, so using MOP is the best deal.
travel.stackexchange.com/users/100596/justinram11
In Shenzhen, many establishments near entry point areas will take HKD, but the exchange rates are usually suboptimal.
One such area is Shuiwei (Shui Wai) 水围 area, which is frequented by guests from the Hong Kong (it was notorious for being a red light district in the past, but not anymore --- mainly just restaurants and cafes now).
Many of those restaurants and cafes take payments in HKD, but really that's about it.
To a lesser extent, some establishments in Shekou (Shek Hau) 蛇口, Wenjindu (Man Kam To) 文锦渡 and Shatoujiao (Sha Tau Kok) 沙头角 might take HKD.
Of course, shops on the Shenzhen side of the Chung Ying Street 中英街 will take HKD.
However, do not count on it: not to mention the poor exchange rates, you don't want to wander around searching for a store that takes HKD!
In the past (i.e. when my parents were still young and when Hong Kong was still under British rule), most shops in Shenzhen did accept Hong Kong dollars, and HKD was a de facto second currency in Shenzhen; this situation continued into the early 21st century.
Now, using HKD in Shenzhen is limited to the aforementioned areas.
HKD is almost universally accepted in Macao (especially in the casino area), so no problem there.
travel.stackexchange.com/users/55892/xuq01
One very important thing about Macau is in most if not all casinos you must have a mainland China, HK or Macau identity card to take out cash at all no matter the currency or the Amount, even with a foreign card or a local card its the same, caught me out big time had to take the boat back to HK to take out the amount I needed for a poker tournament.
This was the same in the large shopping malls as well Not sure about the atms outside of the casino complexes though maybe someone can add about that
travel.stackexchange.com/users/60371/Matt Douhan
I'm going to Hong Kong next month and planned to visit Macau and Shenzhen (maybe Guangzhou).  So are HKD accepted in Macau and Shenzhen or I must pay with local currencies (MOP/RMB) ? And vice-versa, can I use MOP or RMB in Hong-Kong if I have a surplus of currencies ?
Can I pay with HKD in Macau or Shenzhen?
travel.stackexchange.com
<money><exchange><hong-kong><macau><shenzhen>
travel.stackexchange.com/questions/142614
travel.stackexchange.com/users/98141/Van Diest
HKD are usually accepted in Macau but any change which you might get would be in the Macanese currency. In  Shenzhen, HKD are very rarely accepted - especially if you get further away from the border area. Establishments near entry point areas will take HKD, but the exchange rates are usually poor. HKD is generally accepted in Macau, but not in Shenzhen with the exception of areas near entry points.
HKD is usually accepted in Macau. In Shenzhen HKD is not accepted other than near entry point areas.