As long as light stays in the one medium (air or glass) and does not hit anything like a mirror, it will travel in a straight line.
When light rays travelling through a medium reaches the boundary of another medium, they turn back to the first medium.
When a beam of parallel light rays is incident on a smooth and plane surface like a plane mirror, the reflected rays will also be parallel.
Consider an object is placed in front of a plane mirror at a normal or perpendicular distance from it.
Two plane mirrors are used in the periscope to reflect and change the direction of light rays.