[Edit: Sorry, I've written a pretty disorganized post here, and I've played with it a bit; apologies for the messiness.]
I can answer this for Britain; other Anglophone and European countries followed some of the same patterns, but with important variations that are beyond my knowledge. This answer does require some consideration of just what "junk food" actually is, because the early twentieth century existed in a world that still saw the problem of food as one of scarcity, not abundance.
Our current definition of junk food is based on abundance. "Junk" food now is such because it will make you fat; say, burgers and fries or fish and chips. Modern medical knowledge tells us that fatty, salty, fried foods, or foods with a lot of sugar like soda or candy, are bad for our health, leading to obesity, diabetes, and heart disease. They're a "guilty pleasure" because they taste good but are unhealthy--but the real "problem" of those foods is that we eat too much.
In the early twentieth century, that kind of cultural-medical discourse just doesn't exist. People eating too much is just not seen as a problem (socially--individuals certainly could do it). The wealthy might eat extravagant, multi-course meals that we would see as ridiculously opulent and unhealthy because of the amount of fat, salt, red meat, and so on; however, you just don't see contemporary physicians looking at those things are problems socially, because that was basically fine for the wealthy, because they could afford it. If poor people were eating that kind of thing, then that would be a problem, but it would be a problem because it was wasteful. Instead, the problem then was people eating too little. And in Britain in the early 20th century, the people doing most of the looking and judging of this were not necessarily physicians, but middle-class "reformers" looking at the working class. For them, the "junk food" of the day was white bread and tea--sort of a "guilty pleasure," but not because they worried about poor people getting too fat, but because they claimed that such a diet was wasteful.
The globalization of Britain's food supply chain in the second half of the nineteenth century, combined with a revolution of flour milling technology in the 1870s and 1880s meant that by about 1900, white bread was available for everyone. Prior to about 1870 or 1880, people certainly ate white bread, but it was not as ubiquitous as it was by the end of the century, and it was frequently "white" only thanks to adulteration with alum, a bleaching agent (that's its own story, but alum went from nearly universal or practically gone between about 1850 and 1890). Tea underwent a similar pattern slightly earlier in the nineteenth century: the preserve of the wealthy in the seventeenth century, it became a common luxury in the eighteenth century, and a universal necessity across the nineteenth century. In part, this was possible through the expansion of cultivation in India and Ceylon, across the nineteenth century, which obviously increased the supply and drove down prices. By 1900, white bread and tea (and sugar) were universally available, and cheaper than ever across Britain.
Middle-class reformers in the late nineteenth and early twentieth centuries were concerned with working-class diets, and there were many who conducted surveys of what working people ate. They found that many subsisted on a diet of white bread and tea, working men eating as much as a pound of white bread per day, and tea the preferred drink. How common this actually was is difficult to determine; certainly after 1850, there was a rise in real wages across Britain, and a much wider variety of food products became available at lower and lower prices. These included imported tinned or frozen meats, processed food like tinned fruit, bottled sauces, and prepackaged biscuits and sweets, and even some fresh fruit. A variety of local fruits and vegetables had also been available in British cities, including cabbages, kale, and root vegetables like potatoes and carrots. With this variety available and with the increase in real wages, we know that by 1900 the British working class was eating considerably better than it had from, say, 1830 to 1860. Still, there was likely a subset of the very poor who continued to scrape by on the very cheapest foods available, white bread and tea. These were families that probably couldn't afford meat more than one a week or even once a month, couldn't afford the fuel to cook very much, and very likely had little time away from working to do so anyway. Bread, especially freshly-baked bread, and tea were warm, and provided enough energy and chemical stimulation to keep them going.
Middle class reformers were horrified by this revelation, but for complex reasons. White bread was not at the time seen as necessarily less healthy than brown bread; in fact, many physicians considered it a far more efficient food, and thereby preferable. The idea that there were micronutrients necessary for health that might not be provided by white bread and tea was certainly there, but it was not a culturally dominant idea until really after World War I. No, the problem with white bread and tea, I would argue, is that they represented poor people eating above their station. White bread and tea had both been traditionally the preserve of the wealthy, and though globalization had pretty much made that consumption pattern obsolete, those cultural ideas continued. Middle class reformers were offended by the poor eating white bread and drinking tea because, to them, the poor shouldn't be wasting their money on them. They should, in the eyes of reformers, eat brown bread or oatmeal, and drink milk--never mind that those products could actually be more expensive, so that white bread and tea was not necessarily an uneconomical choice. At the same time, the middle class thought it was fine for them to eat white bread, because their diets were more diverse.
So, in this way, "junk food" at the time was basically what poor people ate.
The main scholarly texts for this are Christian Petersen, Bread and the British Economy; Derek Oddy, From Plain Fare to Fusion Food; John Burnett, Plenty and Want. If you want more specific references, let me know.