Floating washers in open taps are a common cause of the water-hammer noise. Most likely culprit is the tap washer in the cold supply to the hot water tank. This is open, and can move with the pressure waves. Check all the open valves (hot and cold) – eg: washing machine, toilet cistern supply, external tap with a timer on it, etc.
How to fix: buy a washer assembly with a brass stem. Flatten the stem with a hammer, so it is a very tight interference fit into the tap assembly. (A fine file can be used to relieve the washer’s stem if you have flattened it too much). Reassemble. Turn the tap off tightly, before re-opening it.
Another cause could be the flexible supply hoses on the washing machine. Sometimes they can bang the wall or washing machine, in response to the pressure waves.