It is route and tariff dependent.
For instance, MAD-PAR outbound with a ZSAPES fare basis can only be combined with a J/C/I/Z fare whereas PAR-MAD outbound with a ZLSFR fare basis can be combined with any Q or higher fare.
AFAIK, most flex business class fares can be combined with any AF fare in class whereas Z fares can sometimes be more restrictive.