I an not sure which iMacs you are talking about but the ones with the extendible screen mount thing were launched when MAC OS X was Jaguar so 10.2. They are mostly G3s but there are some out there that are G4... So yes they run OS X...

So much has changed since the days of Jaguar though and if you get that bad boy, I would seriously recomend a software upgrade (subject to the specs ).