You can credit different flights on a ticket to different frequent flyer programs. Note the rules about credit for flights have differing rules in respect of flights marketed by one airline and operated by a non-alliance airline or vice versa.
For example, if your CX operated flight was purchased as an AC codeshare it will not earn miles on Miles and More and also will not earn miles on Asia Miles.