Depends on the situations;
Yes, when creating a family, it is just a random chance to have the doll already in the inventory;
When pollinating, then yeah, the mother will look up a new mail saying some weird family sent them a special toy, and once u take the mail it automaticly goes to the babies inventory;
Now there are bugs indeed wandering around of dolls missing, imaginary friends missing: Most of the times evicting and putting again on the house is enough (for me it wasnt ._. ) , they sometimes can just become invisible, or tottally disappear, but its also a chance. My first ever imaginary doll didn't have one single bug.