I was recently told department stores used have X-ray machines that they’d use to make sure a shoe properly fit. This was obviously before the risks of radiation were known, but how did we figure it out? I’ve read Nagasaki and Hiroshima helped, is this really where we learned this?

by nueoritic-parents
restricteddata

The X-ray machines for shoes entered into production in the 1920s, during a period of extreme public enthusiasm about the beneficial effects of radiation. At that time, while the knowledge that very high-levels of X-rays could be dangerous (they can cause burning and scarring — Google "X-ray operator hand" if you want to lose your appetite) was known, the carcinogenic effects of lower levels of radiation exposure was still very uncertain. In terms of the general public, the dangerous effects of radiation were not really appreciated until the case of the "Radium Girls" became fairly well-known (late 1920s, through 1930s), as well as the very well-covered case of millionaire Eben Byers, who died in 1932 after self-exposure to too many radioactive supplements.

Scientifically the effects of radiation were studied over this period, and starting in the 1930s there began to be recommendations issued for how much radiation one ought to be exposed to for the first time. These gradually became more strict over the course of the 1940s, as more research was done into the mutagenic effects of X-rays, and the adoption of the linear no-threshold model of radiation hazard, which asserted that carcinogenic risk is cumulative with exposure at any level.

Hiroshima and Nagasaki surely came into this both as a cultural touchstone and as a stimulus for further research. By the 1940s the public associations with radioactivity were largely very unfavorable, and increased scientific scrutiny had made it clear that low levels of pointless exposure (exposure for its own sake) were things that ought to be avoided in the interest of due diligence. Regulation of said shoe machines began in earnest in the 1950s, following the publication of several warnings from scientists that they potentially could create health hazards (one foot X-ray is not a problem, but if the machines were poorly calibrated, or people used them many times, or even just the cumulative effect of millions of people increasing their exposure, all could potentially add up to real harms).

As to your question about how the risks of radiation were known, the answer is, through a number of research avenues. In the 1920s there was research done into people who had industrial exposure to radiation (like the Radium Girls), as well as on the mutagentic effect of exposing experimental animals (famously fruit flies) to X-rays. After Hiroshima and Nagasaki, the surviving victims became experimental subjects themselves, of the Atomic Bomb Casualty Commission. And after the development of nuclear weapons, one of the major avenues of government funded research was into radiological effects on animals (and sometimes, illegally and unethically, on people).

So it was less of a "we didn't know, and then we did" situation, than a steadily growing body of research onto the effects of radiation, especially at low-levels, onto human and animal health. This research still continues to this day; every year there are new studies that attempt to clarify this relationship, especially for the less-well-understood low end of the exposure chart.

On the popular understanding of radiation as a threat, see Spencer Weart's Nuclear Fear: A History of Images. On the development of radiation standards in the USA, see J. Samuel Walker, Permissible Dose: A History of Radiation Protection in the Twentieth Century. On the use of victims of the atomic bombs in this work, see M. Susan Lindee's Suffering Made Real. And finally, on the alluded to human radiation experiments, see Eileen Welcome, The Plutonium Files.