Both of these appliances are famous for having quick-acting solonoid valves
that can cause WATER HAMMER
much like you are describing.
Check out this link for more information on water hammer: What is Water Hammer?
I would have you start by reading that link and then go to the water heater and see if you can find LOOSE HANGERS on the pipes. Chase the pipes out a bit and see where/if pipes are hung poorly... if so, fix hangers or install a couple where the pipes may hit the joists or rub up against anything solid... including wood through the floor.
If exploring hangers and hanging pipes doesn't improve things then it may be a good idea to install an AIR HAMMER ARRESTOR at or near the dishwasher and washing machine water pipes. If you have found that this problem has been getting worse over time
it may actually be that you have an older style of shock absorber/arrestor already piped in the house (behind walls where you cannot see them) and these pipes have filled with water over time and need to be bled down to work correctly again. To restore them (IF THEY EXIST) you will need to shut the water main off and then open all the valves/faucets in the house (ALL OF THEM) and let them sit draining for 20 minutes... ok? Then simply shut all faucets/valves and turn the water back on (purge air/water through basement faucet if possible), bleed the water/air from each faucet and then go give the dishwasher or the washing machine a run. If water hammer is improved then plan on repeating this every couple years or so and you should be all set!
Let me know what you think here...