Yes. You can buy medical insurance for anyone, as long as the identity of both the insured person and the person paying for it is confirmed and the relationship between you is stated.
Please note that the insured person will always be the “owner” of the insurance policy, and they are the only person who can claim on it. So whilst you can buy medical insurance for someone else, it is always their policy and will be administered by them alone.