The fruit cannot heal itself. If the tomato is ripe, you can pick it and just cut the bad parts out. If it's not ripe, it may be a loss, because being open to the outside like that, it will probably get rotten before it gets ripe.
Start looking carefully for your culprit. If they are almost dime sized holes, that could well be hornworms. They are big green caterpillars, but for their size amazingly hard to spot, since they mostly hold still and are exactly the color of the plant.
Other possibilities could be slugs, birds, squirrels (if the holes are shallow and a bit ragged)