It was not uncommon for Egyptian and Roman slaves (at least) to be literate (whether before enslavement or taught as slaves). For example, Greek tutors were in high demand.
It's hard to estimate what the literacy rate was; certainly it must have been much lower than in modern OECD countries. In Rome, unlike, say, Sparta, there were no schools; teaching was all done in the home, so if you were a plebian it's less likely you could read. OTOH the roman soldiers typically could read. And most of the surviving graffiti in Pompeii doesn't look aristocratic.
I think Rome probably had a literacy rate on par with contemporary Greece and Egypt; higher than contemporary China's and probably comparable to India a millennium earlier (inferred from the prevalence of public proclamations (e.g. Ashoka steele), compared to the more "aristocratic boasting" of Roman and ancient Egyptian monumental writing aimed more at fellow elite.