No
They have different cable pulls.
You can use a 10spd mtb rear mech with 11spd road shifters, but they sometimes can’t deal with the width of an 11spd cassette
I have 11spd rival hydro shifters with 10-42 11spd cassette. I tried a 10sp X7 mtb mech – worked but didn’t make it to the lowest gear (physically wouldn’t go that far with the limit screw backed off). I tried a an NX 11 mtb rear mech – didn’t work anywhere (different cable pull). I tried a short cage rival one rear mech, didn’t get on with the bigger cogs (can’t get enough b tension at the top, and resulted in poor chain wrap on the 10).
I caved in and bought an apex one longer cage rear mech and it works flawlessly.