if it’s a one-piece rubber
if it’s a one-piece rubber sleeve under the foam, it’s unlikely you’ll be able to do it. Best trick I remember is to actually use a hammer and tap through the grip and use the end of the bar to cut a perfect hole in the end of the grip before you move it inwards to fit the bar ends.
If they’re a one piece rubber grip underneath and you want to keep them, I can’t see any other way of doing it.