Using the possessive here sounds much more natural. To use the other expression, you need to say "those of," because it's referring to eggs, which is plural.
I don't want to put my eggs in a fridge like those of a chicken.
This is grammatical and understandable, but sounds a little stilted. Since your question was "when to prefer" this usage, I'm trying to think of a time when I might prefer it, but my imagination is failing me. The only thing I can think of is if I were trying to write a story with an extremely proper or curmudgeonly character in it, I might actually want her speech to sound like this.
Alternative: "I don't want someone to put my eggs in a fridge as if I were a chicken" – mplungjan – 2017-12-16T08:18:19.150
@mplungjan That's an improvement in clarity, but I'd argue it's too much of a change in connotation, especially for reported speech. Do we think Mary is worried about herself or her potential offspring? – joiedevivre – 2017-12-16T19:48:28.817
Herself obviously - like a chicken – mplungjan – 2017-12-16T20:25:11.543