Altitude sickness is caused by the low oxygen levels in the air at high altitude. Altitude sickness usually manifests after 6-24 hours at high altitude (over 3000m). Therefore, in a plane, you are usually not at high altitude long enough to suffer from altitude sickness. Furthermore, aircraft are usually pressurised, which means that a certain level of oxygen is maintained inside the cabin. The air you breathe will have a higher oxygen content than the air outside.