No, you can't just buy life insurance on anyone.
There must exist an insurable interest between you and the person you insure for life insurance.
Insurable interest means you have a financial interest in that person, either he/she provides you with some financial support, or you would stand to lose financially if the person were to die.
There does exist insurable interest between spouses, siblings, parents and their children, relatives, and business partners, among others.
Here's an article that provides additional information on the questions "Can you buy life insurance on anyone?"