In the US, when you're brought to the ER you're in one of two states: incapacitated or becoming incapacitated. If incapacitated the responsibility under the
Emergency Medical Treatment and Active Labor Act is immediately engaged and identification is only obtained once the patient is stable, though they'll try their best to keep you from leaving until they've done that later.
If not incapacitated, the ER will simply wait until identification is provided or incapacitation sets in.
You cannot be forced to be treated by an ER or even transported there, unless you are too physically incapacitated to speak (informed consent rules come into play here, a reasonable person does not want to be left to bleed to death on the street) or are declared mentally incapacitated under that state's
Baker Act, which in most instances has a 72 hour limit unless a lasting state of danger to one's self or others is assessed by a psychiatrist. I'm not sure if all states have analogues of the Baker Act, several certainly do, but exceptions wouldn't be heard about much.
If you were transported to the ER and
then refused treatment, they'd still try to retain you for ID so they can bill you for the ambulance ride.
Now, all that said, hospitals are in a constant state of conflict over obtaining payment for their services and not all of this applies cleanly in reality. I've heard of cases of known homeless people all being assigned one same fake address, and such.