In boxing the referee does have the discretion to ignore the towel thrown in

Ive seen it done occasionally. The referee is right there and can see if a fighter can go on or not. So fighter safety is first and foremost followed. When the ref doesnt acknowledge the the towel thrown in, usually the fighter can go on. Just that his corner thinks he has had enough.

Referee refuses to stop heavyweight fight after boxer’s corner repeatedly throws in the towel - The Athletic https://share.google/QObe7ShaWGPCTUZle

Remember Roberto Duran vs. Davey Moore? The corner should have thrown in the towel since Moore was taking a severe beating and losing all the rounds. Moore hadnt won a round after 7 rounds and unless he got a KO he would have lost the fight via a lopsided decision. He corner could have thrown in the towel and saved Moore from a bad beating. After he got knocked down, the ref should stopped the fight in that round or the next. Jose Torres, former Lt. Heavy champ was shouting from the front row to stop it, it was that bad. Moore could have been killed. He was never the same afterwards. Finally the corner threw in the towel in the 8th round.

If you are a Duran fan, like most of the crowd that night. It was a great savage fight.