Mounting the sensor closer to the engine will heat it up faster and the water condensation phase, which is the most common cause for failing sensors, will be shorter.
The sensor should be placed on the upper surface of the pipe, from 9 o-clock to 3 o-clock position. If it has to be placed on a curved section it is better to be on the inside of the curve because placing it on the outside will get it exactly in the way of the exhaust stream and water condensation.
The lambda sensor will work fine even if it’s not sticking inside the exhaust pipe but is entirely protected by the weld-on bung or boss.
The lambda sensor can be mounted at an angle towards the pipe which is not 90 degree. If it points away from the exhaust stream, it will be a lot harder for the water condensation to hit the inside of the sensor and damage it.