The OED has it from 1941 and originally Australian.

They say:

> Origin uncertain; perhaps related to duff n.1 b, and hence analogous to similar slang phrases for pregnancy such as *in the (pudding) club* or *to have a bun in the oven.*

*Duff* n.1 b* is a flour pudding that's been boiled in a bag, or a dumpling. The *a* sense is simply *dough*. Of this they say:

> originally a northern pronunciation of dough n.: compare *enough*.