You should always put foundation first before applying contour.
There are a few reasons for this:
Reason 1: Especially if you have a light skin tone, applying the darker shade under your foundation can lead to it mixing together and creating an ashy grey color on the cheeks.
Reason 2: If your foundation is full coverage, you may just fully cover all the work you did on your contour leaving it unnoticeable
Reason 3: If you are using a powder contour, it is very rarely advised to put powder under a liquid so you may create separation or texture issues.
Reason 4: A lot of contours are cream-based and a lot of foundations are water-based and just like oil and water in a pan, different based products may cause them to separate on the skin. You usually want to mix like products (cream with cream or water with water). If you want to mix oil-based products with water-based makeup products, you want to have the oil-based product sitting on top of the water-based product, just like it would in its natural separation if you mixed them in a glass.
You want your contour to look as if it is coming out of your skin instead of on top which is why you might find recommendations to apply it under your foundation. We recommend achieving this by applying your contour and
then using the brush or sponge you used to apply your foundation to finish blending the contour in. It will give you the same effect without all the complications!