Well, yes and no. If it is a flight which does not have first class at all then, yes, you get business class mileage.
However, if you booked in A and get involuntarily downgraded to business due to overbooking then you should still get first class mileage (likewise it you get op-upd from D to First you still get business class mileage).
In my case I have taken a voluntary downgrade when booked in D, but with my gf on an economy class ticket. In this case I managed to talk CX in to giving me business miles even though I flew in economy.
I'm not sure if this would work if there was no A/D availability so that I had to involuntarily booked in D/M.