Bit of column A, bit of column B; I'm confident that Facebook and Google have huge datasets of people's personal information and photos, but they will not use them in anything public facing, because they know this scares people and will cause huge lawsuits.
So for the public image generators, they will use public images; I believe places like artstation and flickr will be used a lot. Also because they will include metadata, either on the descriptions or in the photo's metadata, about the location, scene, setting, camera, etc.
Then (and I'm mainly thinking of Dall-E here) there's other open caches of data, like collections of artwork along with intricate descriptions of what they depict.