Yes, the pilots can open the cockpit windows in aircraft like the A320. When the aircraft is on the ground and unpressurised it is quite easy. In flight the side windows can be opened but only in an emergency and if the aircraft is fully depressurised and speed is below 200 knots.