Dynamo hubs create alternating current. And fairly peculiar alternating current at that: although they are nominally are 6 volts, you can easily get several tens of volts by riding fast and connecting a high resistance load (or no load at all). They are intended to be used with 12 ohm load, in which case they output 6 volts and 0.5 amps at normal riding speeds and any speed higher than that.
If you reverse the rotation direction, it will reverse the flow of current. But since it's alternating current, it doesn't affect you in any way at all. It's equal to disconnecting a device connected to 230V mains socket, reversing the plug and connecting again. In many countries, the 230V mains plugs connect either way and work equally well either way.
Edit: as Nathan Knutson found out, some dynamo hubs still could self-unscrew if rotating in the incorrect direction. So you probably want to check Consequences of driving a dynamo backwards -- electrically, they work but mechanically it depends on the hub model.