Will a nuclear bomb stop an earthquake from happening?
A nuclear explosion in the subsurface will result in ground motion which in theory can trigger an earthquake (due to passage of dynamic waves) if a locked fault has already accumulated sufficient strain over the last few decades/centuries due to slow motion of plates.

Having said that all the nuclear stockpile in the world is not enough to obliterate even a small part of the plate boundary. The 1960 Chilean earthquake released accumulated strain energy of the order of 3 Gigatons of TNT or 200 Gigatons of TNT equiv or 12 million Hiroshima type bombs (Numbers are based on calculations by JC Lahr and are available at http://www.jclahr.com/alaska/aeic/magnitude/energy_calc.html)

So yes, an explosion in the subsurface can probably act as a trigger for an impending earthquake but it cannot stop if from reoccurring again after few decades/centuries.