Preferential flow in a porous medium is commonly encountered in many practical applications. Our previous studies have discovered the preferential flow-induced non-monotonic wettability effect on displacement (J. Fluid Mech, vol. 942, 2022a, R5), but whether this non-monotonic rule is consistent for different disordered media and the impact of the interplay between the disorder and wettability under preferential flow conditions is still not well understood. Here, we combine microfluidic experiments, pore-scale simulations and theoretical analysis to study the impact of the disorder on the invading process where wettability varies from strongly water wet to strongly oil wet. Even though the strongly disordered matrix varies to a uniform state, the generality of the preferential flow-induced non-monotonic wettability effect is still proved. However, the previous pore-scale dynamics based on the strongly disordered matrix cannot explain the invading behaviour in the uniform matrix under preferential flow conditions. New mechanisms for the uniform matrix are further investigated by pore-scale modelling, which indicates that the balance of microscopic imbibition ability and the macroscopic interfacial stability dominate the invading process. We derive a theoretical model to describe the wettability effect and predict the optimal contact angle, which fits well with experimental and simulation results. Our work extends the understanding of the impact of preferential flow conditions on the wettability effect and is also of practical significance for engineering applications, such as geological CO2 sequestration, enhanced hydrocarbon recovery, soil wetting, liquid-infused material fabrication and microfluidic device design.