You can’t transfer points between frequent flyer programs in most cases, even if the airlines are partners. Partnerships such as OneWorld, Star Alliance, and SkyTeam typically allow you to earn miles when you fly on one airline, and redeem those miles you earn for flights on a carrier within the same network. However, most of those airlines won’t allow you to transfer miles directly from one carrier to another, because there is no financial benefit to them for doing so.
But there are some exceptions to the rule. British Airways and Iberia share the Avios frequent flyer program. So while your points in each program remain separate and distinct, you can transfer them freely between the two.
Just because you can’t transfer points back and forth, however, doesn’t mean that you are stuck with a single carrier for life. Most airlines within the major alliances will allow you to use your mileage stash with that brand to book award flights on partner airlines. For example, an American Airlines frequent flyer can use AAdvantage miles to book a flight on British Airways, and the cost of that ticket will be based on the American Airlines mileage award chart.