When you purchase an airline ticket for a flight there are up to 3 airlines involved for each leg of the flight :
1. The "operating" carrier - this is the airline that is actually operating the flight
2. The "marketing" carrier - this is the airline of the flight number that you purchased.
3. The "ticketing" carrier - this is the airline that you actually purchase the ticket from.
For example, you might buy a ticket on Delta flight 1234. But that flight is actually a codeshare flight that's really flown by Air France, as AF567. And you might have bought the ticket itself from KLM.
In that case, Delta is the "marketing" carrier, as you purchased their flight number, DL1234. Air France is the "operating" carrier, as you actually flew on their flight AF567. KLM is the "ticketing" carrier, as you purchased the ticket from them.
Much of the time, especially for simple tickets, all 3 will be the same. You buy a ticket from Lufthansa, with a LH flight number, which is flown by a LH plane.
But for more complex itineraries you might end up with a combination of carriers involved. For example, your outbound flight might be on Delta, whilst your return might be on an Air France flight connecting to a KLM flight number operated by Aeromexico.
In general, the airline you actually purchase the ticket from must be either the marketing carrier or the operating carrier for one of the flights, and normally for one of the longer flights. As a consumer, you the only way you can potentially affect who the ticket is actually purchased from is to but it from a specific airlines website - although travel agents sometimes have the flexibility to buy a ticket from a specific carrier (called "plating").
Now, with all that as background, lets get to your question.
For the most part, what matters when it comes to an airline going out of business is who you purchased the ticket from - the "Ticketing" carrier. If you buy a ticket from Alitalia, and they go out of business, then your ticket is potentially worthless - even if it includes flights with another airline!! ie, even if those flights were with Air France, the fact that the ticket is from Alitalia means your booking potentially no longer exists! In practice, other airlines will sometimes still honor such bookings, but they have no obligation to do so.
The opposite of this is also true - if you had purchased a ticket from Air France, with flights on Alitalia, and Alitalia went under, then your ticket is still valid. Your contract is with Air France, and as they are no longer able to fly you on the existing flights, they will arrange alternate flights on an alternate airline.
So the question becomes how can you purchase the flights you want on Alitalia, but with a ticket purchased from a different airline - and the answer is that you likely can't, or at least not at the same price you are seeing from Alitalia. You can certainly try booking the flights on the Air France website (or any other Skyteam carrier), but don't be surprised if they simply don't show up. If you include a flight from the carrier whos website you're booking on as a part of the itinerary then you MIGHT be able to make it work, but even then it's unlikely you'll get the same price.
The better option is potentially to book the flights with Alitalia and make sure you have insurance of some form (credit card and/or otherwise) that will reimburse you if they go under.