All approved procedures in medicine are safe, when performed for the right indications. Any invasive procedure has associated risks, but generally, the potential benefit outweighs the risk. Stents are placed in arteries, veins, or ducts within glands. For the purpose of this answer, I will focus on the coronary arteries and aorta. There are numerous studies comparing surgery to stents, focused mainly on long-term results.
When considering if a treatment is safe, it is important to divide that concern between the short-term placement of the stent and the long-term implications of having a stent placed. There are long-term consequences including stent clotting (thrombosis), in-stent restenosis (scar formation), and stent migration causing endo-leaks (more applicable to aortic stenting). It is essential to talk to your doctor and/or surgeon to make an informed decision about which procedure is right for you.