The incident is alleged to have occurred during the second half of Saturday's Sky Bet Championship fixture at the Weston Homes Stadium.
A complaint of racist abuse from visiting supporters was made to referee Jarred Gillett by Thompson.
Peterborough said in a statement: "Peterborough United Football Club can confirm that two Birmingham City supporters have been arrested following the allegation of racist abuse aimed towards defender Nathan Thompson during the second half of Saturday's Sky Bet Championship fixture at the Weston Homes Stadium.
"Thompson reported the incident straight away to the match official who spoke with the fourth official before the two individuals were identified and detained.
"The football club condemns any form of discrimination and will work with the authorities."
Birmingham said in a statement that the club has a "zero-tolerance policy towards any form of discrimination" and that they "will continue to assist the police in their investigations" and would "firmly support the action taken against anyone found guilty of such abhorrent behaviour."