There were no Mid 2012 Macs – so I assume that you are talking about a Mid 2011, Late 2011, or Late 2012 model.
Depending on the age of the Mac, it might theoretically support Internet Recovery. I don't know how well Internet Recovery would actually work these days, and even if you got the original version of the operating system installed, that would be old enough that it wouldn't be able to directly access the update for the most recent OS the machine could run (High Sierra for the 2011 models, Catalina for the 2012 ones).
There are ways around that, and if this is a 2012 Mac that can run Catalina, Catalina is new enough to run current versions of the Firefox Web browser, the LibreOffice office suite, and the Affinity V2 applications (Photo, Designer, Publisher). Someone who was aware of the limitations of a 2012 iMac could still get some good use out of it.
However, even Catalina is too outdated to run current applications from the likes of Microsoft and Adobe. If what a charity wants is a computer to run current applications, you may find that they do not want such an old machine.