Yes. A different person than the one who is traveling can buy the tickets online. The important thing is that the passenger's information is noted on the document that will be printed and handed out at the different ticket offices.