The novelisation explains it all.
They (the USM scientists) take samples of DNA from Fury 161. They realise that the alien 'invades' every cell in the host's body to change its DNA and make the host more suitable for the alien to gestate in.
As such, the scientists find both DNA samples intertwined/merged in the blood. Making a clone from these samples would create a hybrid being, since the DNA is difficult to separate. They don't want that, though, so they work hard to disentangle the two DNA types, creating Ripley and the queen inside her as a result. Previous attempts failed, which is why the earlier clones are more or less hybrid beings (part alien and part human).
As others have said, we already see the alien taking traits from its host (Alien 3). This implies the process works the other way around, too, with the host being changed by the alien. (This also may explain why Ripley survived the opening of Alien 3, since the alien DNA probably made her hardier than her companions so that she would survive long enough for the queen to fully develop.)
Later Alien novels (such as The Cold Forge) expand upon this idea in canon. Basically, facehuggers don't implant embryos, they insert a liquid/virus-like material that rewrites the host's DNA to produce the alien as if it were a kind of cancer from their own body. This prevents the host rejecting the alien developing inside them, and allows for the alien to take on traits of its host. This is called the DNA reflex.
The memory thing is handwaved, but we might assume that the alien only inherits alien memories with some vague 'instincts' from its host, and vice versa. Of course, the human doesn't usually survive the process, so it doesn't matter that they retain memories in their DNA.
So Ripley only got her own memories back because her portion of the DNA (presumably) had also encoded her own memories. There's not a lot of evidence that she has alien memories, because that would mean she would potentially remember things from previous hosts (such as the queen's host on LV-426.
Of course, if this is how it works, it raises the question of whether a mother could pass on memories to her child if she was implanted just before giving birth and the child survived. The change in her DNA might encode the memories, which might then pass on to her child. There could have been an even weirder story there with a child who thinks she's her mother and who is also technically the sibling of the alien that burst from her mother.