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...