We know Gollum was one prisoner who was inside Barad-dur and then released
(alive). There might not have been many other spies, though a stray
Ranger or two from Ithilien might have been captured from time to time and
interrogated. It's unlikely that any Elves made their way into the
dungeons in the latter part of the Third Age, though there could have been more
in the Second when the dungeons were originally built.
Sauron had many slaves among the Easterlings and the Southrons, so the dungeons
could have held them as a captive workforce. They could be slaves sent up
from the collective farms in Nurn, or slaves sent from the East and South as
tribute to Sauron. The ones held in the dungeon might have been sent for
the most ghastly work, or maybe as sacrifices (Sauron has a history of that, so
he could still use the same coercive techniques to manage his worshippers in
the Third Age). Run of the mill impressed Men and those forced into
military service for him would be the ones living in the shanty towns Frodo and
Sam see once they enter
Mordor.

Nasmith, Eärendil the Mariner