Yes, you can. Be aware, however, that you are only purchasing the policy on behalf of the legal owner. It’s really not much different than just loaning that person the funds to buy the policy.
Although insurance companies have policies that vary widely from company to company, you will most likely never find one that allows someone without an insurable interest to be a named party on the policy itself. This would lead to unnecessary litigation in the event that a claim is ever filed by the non-insured party. And insurance companies go to great lengths to lessen, or completely avoid risk, whenever possible.
And be aware that courts have previously held that even though you may have unwittingly paid for some type of protection you “thought” or “assumed” you were getting on a policy, you are only legally entitled to that protection if it clearly states the protection in the policy. Therefore, I would take a close look at the wording of a policy if an agent claims it offers the coverage you desire.
Now, if the property is held in an LLC, corporation or family trust, there is a little more latitude to buy insurance. As long as you had an interest in one of these entities, then you would also have an interest in any real assets they owned, and would, therefore, be able to insure.
Finally, having interest in the property does not necessarily mean you must be named on the mortgage or any deeds, liens, etc. Remember it is the Insurance company themselves who make the final decision, so if you can prove an interest in the property, they will most likely allow you to be a named party on a policy. So, for example, if you have a personal note for a loan you gave a property owner, which indicates there is some consideration for his real property to secure the loan, you may easily pass the insurable interest test for the insurance company.