Is it okay to ask your research paper co-author (first place) to write a letter of recommendation for your PhD admission?
Yes, this is completely ok, even recommendable. You want your letter writers to know how you function in a research context. It does not matter if this was as part of a university research project (such as a thesis) or some other project that you worked in for some reason.

The main reason why most applicants use their former research advisors is because this is the primary way how undergrads get in touch with professors in a research (as opposed to a classroom) context.