Yeah, there was a kids' documentary made about fast-food photography a few years back. Basically they will just use a skillet to surface cook (brown) the outside of the patty to avoid the shrinkage that occurs when you grill a burger (lots of water and fat drip out and evaporate). This sort of answers the parent's question too. It's definitely not safe to eat.
IIRC, in the Burger King ads they heat thin metal strips and use them to sear lines into the patty, giving the "flame-grilled" illusion without having to cook and shrink the patty.