The embassy or consulate that will be granting the visa will not insist that you purchase a ticket before you apply for a visa in case the application is rejected. They do need to see a flight itinerary with your application, but a confirmed ticket is usually only required when picking up the approved visa.