Due to differences in air pressure, it is usually not in fact possible to open an airplane door during flight at normal cruising altitudes, despite what you may have seen in the movies. This goes for all doors of an aircraft, including emergency exit and main doors; you could fuss with the opening mechanism as much as you like, but you wouldn't ultimately be successful. Interfering with the operation of an aircraft is a criminal offense in some regions, however, so you may be penalized for touching the door during flight.
Commercial aircraft have pressurized cabins to facilitate passenger comfort and so that the oxygen level in the cabin can be easily controlled. Without a pressurized cabin, passengers would need to wear oxygen masks, and they might get physically uncomfortable at high altitude. The difference in pressure between the inside of a plane and the outside essentially seals the doors of an aircraft even without latching, although most planes have pressurized seals as well, for safety. If you tried to open an airplane door during flight, you would find that you would not be strong enough to overcome the pressure differential.
In emergency situations, pilots bring planes to lower altitudes and slowly depressurize the cabin so that the doors of the aircraft can be quickly opened. Passengers sometimes notice rapid pressure equalization because their ears may pop due to quick changes in pressure. Should a plane suddenly lose pressure at altitude, as has happened, oxygen masks drop from the ceiling so that passengers do not pass out from lack of oxygen. In these circumstances, it would be possible to open the door during flight, although it wouldn't be a particularly smart move.
The cargo sections of planes may not always be pressurized, which means that cargo doors can come open during flight. Since people aren't usually in the cargo bay, the risk of this occurrence is minimal, unless a cargo door malfunctions, as happened in 1989 on a United Airlines flight to Hawaii. Specialized aircraft such as planes used for skydiving obviously remain unpressurized so that the doors of the aircraft can be opened, allowing people to jump out.
Numerous safety measures are in place on aircraft to prevent catastrophic accidents when flying at high altitude. Cabin doors are an excellent example of what is known as redundant safety mechanisms, a series of mechanisms which are used to ensure that it is impossible to open an airplane door during flight, even if one mechanism fails. It is important to pay attention to safety lectures of videos on board aircraft, since you may need to know how to open the cabin door in an emergency landing, and different planes have different procedures.