eh... when you are ruler. you are not part of any duchy (unless you were duke before... in which case, you are ruler+duke)
as ruler, if there's a vacant duchy position, then i don't see why you can't appoint yourself. if there isn't a vacant one, then you have to create a new duchy out of a town/city... though obviously it still means you won't be the duke, because you ain't the lord. that said lord/duke will have to drop off being duke to create the vacancy...
Said ruler/duke/lord was made duke only because of a random bug. I'm pretty confident that once I'm back in power, I'll be able to convince him to step down as a duke of the duchy he illegitimately got (while keeping lordship of the city). Especially since it seems that my radical stances are more wide-spread in the realm than I thought they were initially.