In some games, yes — usually through a cheat that enables wall clipping. That effectively turns off collision, letting you pass through walls, ceilings and floors, and often leaves enemies unable to register you at all.
Dedicated photo modes are far more common now than they used to be, and they're the better option: proper camera controls, zoom and depth of field without breaking the game.