For example, If I got a PhD from a school in Pakistan or North Korea would the United States still legally recognize it?
No. Nor would the United States recognize your degree if you got them from the UK or France, or even from within the United States. The United States does not legally protect or sanction PhD holders as such, and has no role in the awarding of nor forming guidelines for PhD programs (other than funding, directly or indirectly, much of the research that is required).
Your comments suggest that you think there are legal issues with falsely claiming to hold a doctorate; there are not, outside of normal fraud concerns for deception (wherein someone relies on you or your expertise to their detriment, based on your ), which can affect legitimate doctorate holder's as well (for example, someone with a doctorate in Music presenting themselves as an expert in Economics, for the purposes of soliciting investments, say).
For example there are a variety of performers who do not hold doctorates, but legally have stage names containing "Doctor" (https://en.wikipedia.org/wiki/List_of_stage_names has a dozen), because they are committing fraud in doing so (a claim of "I liked this song when I thought it was written by a PhD" would be laughed out of court, because holding a PhD has no bearing on musical composition).
There are, however, legal issues with falsely claiming to be a member of certain legally regulated and licensed professions in the United States, such as lawyers and physicians. I believe that this is the source of your confusion, as these professions often have protected titles that contain the term "doctor", such as physicians (MD, for Medical Doctor, and dentists(DDS, for Doctor of Dental Surgery). It should also be noted that physicians are almost universally addressed as "Doctor", but very few actually hold doctorates, the MD being a non-academic professional degree that doesn't require doing any new research.