Can PhDs legitimately claim to be doctors?
In the modern USA the title of doctor is valid for both medical doctors and holders of PhDs in the US, but particular customs may vary by institution. The general rule of thumb for etiquette is to refer to someone however they wish to be referred to. If you have a PhD that insists they be referred to as doctor it would be very impolite to not do so. Likewise if you have an MD who insists that you do not use their title it would be similarly impolite. 

In situations where it is important to avoid confusion it is common to spell it out explicitly. Rather than using the honorific use the explicit degree, for example it is very common for email signatures to look like:

John Doe, Ph.D. in Computer Science

instead of

Dr. John Doe

Similarly, an MD would tend to say:

Jane Doe, MD, Cardiologist

or even

Jane Doe, MD, Ph.D., Cardiology

I suspect that your question has another component, which is essentially whether or not it is "fair" for a Ph.D. holder to refer to themselves as doctor. This requires an assumption that the MD is more challenging to attain than a Ph.D., and that calling oneself a doctor is somehow illegitimately taking the status of a medical doctor. Let me just say that the people who have earned these degrees are generally less concerned about this than those who have not, and that the title someone puts after their name doesn't tell you very much about their individual ability, dedication, or experience.