Sort of like a sailboat, except the wind is the vaporized material from the nuke. The nuke explodes, throwing a ton of mass and energy in every direction. The rocket uses a sail or pusher plate to catch part of that mass and energy, which carries it forward.