What is - if any - the difference between PhD and doctor?
It's not the difference between "doctor" and "PhD". It's the difference between "real doctor" and "PhD". 

"Real doctor"=someone who performs surgery, prescribes medication, etc.

"PhD"=Doctor of Philosophy

The joke is PhD's aren't "real" doctors. When someone says "I need a doctor", they aren't talking about needing an expert in the jackets of 1860s Chicago or Teichmueller spaces. They need someone to help with their medical ailment.