Hi,
Yes this is possible: Enable Defender for Servers at the resource level. Enable it only for the VMs that you need and you will be charged only for them. Do not enable it on the whole subscription.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.