Yes, you can get life insurance on other people.
There must be insurable interest as defined by economic loss at the demise of
the policy insured.
That means, you must suffer some financial loss of the insured person were to die, or you rely on the insured person for some means of financial support.
If no such financial liability can be established the life
insurance company will deny the application. Unrelated parties with no business
nor personal economic relationship cannot “take out” a life insurance policy on
someone else.
However, insurable interest for life insurance does exist between spouses, siblings, parents and their children, family members, and business partners, among others.
Here is an article called "Who can you insure for life insurance?" that providers more information on insuring others for life insurance.