Operations began a long time ago - back in the Neolithic, including such complex ones as craniotomy (the oldest trepanned skull is 10 thousand years old). For example, here is an article by anthropologist Maria Borisovna Mednikova: Primitive neurosurgeons: with rituals and without anesthesia. Of course, not everyone survived after them, but still there was a chance to survive, and the operated people lived long enough for the stitches to tighten.
Medical documents are found in the tombs of Ancient Egypt. Tools are also found in Roman excavations. You can also remember Hippocrates. Ancient doctors performed various surgeries, from strip to eye surgeries.
in the photo: the tools of the ancient Roman surgeon found during the excavations of Pompeii.
Of course, the doctors tried to ensure that most of the patients survived. But the discovery of three things in the 19th-20th centuries could make death during surgery rare: the attitude of bacteria to disease and disinfection, anesthesia and antibiotics.
I know for sure that one of the oldest operations was a cesarean section. Testimonies about him say that it was in many centuries before our era. They did it if there was a choice between the death of a mother and a child, or one mother. Also, the Caesarean was done already dead in order to bury the child separately. They began to survive not so long ago, in the 19th century, but the mortality rate during the first operations was then 25%. A little later, the uterus began to be sewn up and by the advent of antibiotics in the 20th century, death became a rarity.