Was the prison into which Joseph was placed (Genesis 39:20) located in Potiphar's basement?
It was like the Bastille or the Tower of London. That is, a prison for the nobility who could be restored to power or killed. Thus, it was not like the pit that Yirmiyahu was put in. Nor was it "Potiphar's basement" (which makes it sound as an ad-hoc lockup), it was an official location, since the "Chief Butler" and "Chief Cook" were put there. Yosef was actually more like a servant to the nobles who were placed there. The prisoners had to be treated well, since if they were restored to power, they would take revenge against the guards if they were mistreated.
In fact, as many meforshim state, Yosef was put there because Potifar knew that he was innocent and did not want to lose his service. However, he had to pretend to punish him in order to save face.
For example Rav Shamson Refael Hirsch on Vayeshev 39:20 says explicitly
... But Potiphar was the Governor of the State prison (see next Chapter verse 3).
This would presuppose that in his heart he was really convinced of Joseph's innocence, and only for the sake of his honor did he have to take the action that he did, ...
Ths is a prison to which both those condemned and those committed for trial were brought. The sequel, too, bears this out.
UPDATE Based on this logic it was probably a separate set of "official" government building. Note that given the prisoners who were placed there, it would be a more "luxurious" type of accommodation. A "basement" would have no windows and would need to be artificially lighted whenever it was being used. This would not have been available in Egypt of that time. A "basement" would only be used for storage (as with a root cellar for example).