yes, possible
I did it often with Star-rtw tickets (credit to Mileage Plus, the next one with the same carrier to miles&more) when the 2 programs had the same promotions running (fly NNN Star-carriers and get NNNN bonus miles) I did fly 2 segments with each Star-carrier on one rtw ticket and always made sure that one segment per carrier was credited to Mileage Plus, the other one to miles&more. So I did get the bonus of up to 200'000 miles in both programs with one ticket.
To get some perks (like waitlisted upgrades, etc) that go with status, enter when ordering the ticket your preferred (the one with better status) program for the whole trip.
* if you check-in for 2 (or more) legs without stopover in between, than present the card you want to be used at the first check-in (you will get all boarding cards then with that FT number on it),
* after the first segment flown, befor boarding the second segment, go to a transit desk (of to the lounge) and let the second segment be changed (often they will just do this in their computer system and not hand you over a new boarding pass showing the other number, but if he credit later on doesn't show upin your account this is more risky),
* etc. etc.