Yes,
you can take out a life insurance policy on someone else if you have insurable interest
in that person.
Insurable Interest means that there is a financial tie between you and the person you want to insure for life insurance.
Either you
would be hurt financially if the person were to pass away (because they owed you
money, because they help support you, etc), or you are helping them financially
now and life insurance would pay you back for your financial loss upon the other person's death.
Usually, insurable interest exists between spouses, family members, and business partners, among others.
Here is an article that explains who you can insure for life insurance.