This question already has an answer here:
We have seen several times starfleet officers beaming aboard Borg vessels and do their thing. As long as they are not a threat. The Borg only assimilate things that are worthy of assimilating. To my understanding anti-matter warheads cannot be transported with the transporter, but nuclear warheads could have (nukes don't use anti-matter). Now take the Tsar Bomba. That nuke was detonated 400 years earlier. But it generated a fireball of 8km in size. A Borg ship would never survive such an explosion. And you don't even need a Tsar Bomba like nuke to destroy the Borg Cube. A much smaller nuclear explosion would do the trick.