Tom Bombadil could have done it easily, the ring was of no more interest to him than a bawble. But he didn't want to leave his place, and they say that he would be a most unsafe guardian who would soon forget about it if they gave it to him for keeping.
So most likely if he could be persuaded to travel to the cracks of doom, he'd soon forget about it or lose it on his journey. Just not the sort of thing that engages his interest and attention for long. Who knows, maybe he'd do the journey if all the free world asked him to. But he'd just forget about it, forget that he'd got it with him, much as you might forget that you have a low denomination coin in your pocket.
Apart from that I agree with Justin, Sam could have given it up, if he hadn't worn it for too long beforehand.
And - what about Gandalf, he said he couldn't take it for safe keeping, but could he have just taken it for long enough to throw it in? After all he was able to throw it into Frodo's fire. So I think he could surely have thrown it in if he had been part of the party.
It is just that if he had it with him all the time, that he says he wouldn't be able to resist the temptation to use it sometimes to good ends in the many trials he would face, and that that would be its way to corrupting him.
HOW THOUGH DO YOU GET THE RING TO THROW IT IN?
John Savidge though points out (comment) - that doesn't explain though how Gandalf could get hold of the ring in the first place without some violent act against Frodo which would "break his mind" - and even if he could bring himself to do that it would likely be just the sort of act that would bind him to the ring so he could no longer throw it in.
So - I think - that if Gandalf had it, as Sam had it, without taking it from Frodo, e.g. because he was left for dead etc, or even been killed, then he could throw it in. But if Frodo still had it, then I don't know the answer.
Probably many people could throw it in if they had it only for a short time, as a result of some mishap that happened to Frodo.
THROW BOTH FRODO AND THE RING INTO THE FIRE TOGETHER?
Another thought - rather an awful one - but - when Sam carries the ring bearer he doesn't feel the weight of the ring. Could someone, e.g. Gandalf, throw both Frodo + the ring into the fire? As a last minute measure knowing that all else failed, and with Sauron advancing on the scene?
Of course I'm glad the book didn't end like that! Logically it seems possible but maybe there is some reason it is not.
KNOCK FRODO UNCONSCIOUS THEN REMOVE THE RING
Or another idea, just to knock Frodo unconscious. After all Sam was able to remove the ring easily when Frodo was unconscious and close to death because of Shelob's poison.
Then - you don't attack the ring directly, or remove it by force against his willing mind.
And he actually at some level wants to be rid of it.
So you are helping him to achieve his goal, by knocking him unconscious and then removing the ring while he is out of it and throwing it into the fire, so it doesn't seem likely it would have a bad effect on your mind also, at least not to the extent you'd immediately lose yourself to the ring.
In that case, just about anyone could do it. Including Sam if he thought about it in time.
How about that idea?
Another problem of course, with the actual scene in the book, is that Frodo is invisible at that point, struggling with Gollum. And any scenario where he claims the ring has him invisible.
So anyway - you'd have to guess where his head was, hit him on the head to make him unconscious, protect the invisible Frodo from Gollum, and then somehow find his ring and remove it. Could be done but a bit tricky.
Or if Gollum isn't there, you have to be able to see him. Or get hold of the ring before he claims it or immediately after before he has a chance to move.
BTW how is it that Gollum is able to bite of Frodo's finger, given that he can't see him when he is wearing the ring? (That's established when Frodo escapes from him in the Hobbit). Is it just by feel?
[John Savidge points out in comments, that Gollum is used to hunting in the dark, and they are in hand to hand struggle, he'd be able to feel Frodo's arm and locate the hand and ring by touch. Makes sense.]
WHO COULD SEE THE RING?
If Tom Bombadil was part of the party, if he could have been persuaded to go along, he also could see Frodo when he wore the ring. And the Black riders could. But I don't know who else could.
[John Savidge in comment suggests maybe White Gandalf could, not tested in the book].
OR ANTICIPATE IT OR QUICK WITTED
So - then would have to be that someone else somehow anticipates what he is going to do. Or else e.g. Frodo says he claims the ring but before he puts it on someone quick witted, and a little wily who has perhaps expected just this and is prepared for it, immediately knocks him unconscious before he has time to put it on, and throws the ring in. I could imagine Gandalf, or Aragorn and maybe a few others doing that.
GOING AGAINST FRODO'S WISHES
They would be going against his wishes in that case - but in quite a mild way.
Because it's clear that it's just the ring's doing, that his intention all along was to throw it in, and that if you threw it in for him, he'd be grateful for what you did, and that if he did put it on, it would turn him into a dark lord himself - except - that he'd only have it on for a few minutes most likely as Sauron was already aware and on his way, and he'd lose it immediately and be tortured for the rest of his life in one of Sauron's dungeons.
It might not be a good idea if you had been hankering after the ring yourself as Boromir did. You might not be able to follow through on your resolve once you have the ring.
But for almost anyone else - well you are right next to the fire, and can throw it in in seconds, probably don't need to be Aragorn or Gandalf, probably anyone could do it I think. Including the hobbits.
Just following through on the impetus of your immediate decision, throw it into the fire before you have a chance to have any other new ideas about what to do. But you'd need to be a bit wily to some extent, expecting it to happen, or else someone who is good at acting on the moment, very quick in your response to changing situations.