Earlier quoted context omitted.
Tip: a photo of your passport and the stamp will most likely do in most circumstances. Much better than risking taking your passport with you all the time.
I cannot think of any circumstances where someone would be demanding to see your passport and then accept a photo of your passport instead. That being said having a photo of your passport and relevant stamps is good advice, but only to make it slightly easier to deal with all the hassel that comes if you do lose your passport.
Unless you are involved with a particular interaction, they just want to check your visa status. A passport photo/stamp will do if their system is digitized. Arresting someone (except for the US where the police likes to arrest people) is a major hassle.