Replicants have their memories and dreams pre-programmed. These pre-programs are known about by those working in the replicant industry.
In the film Deckard has a dream about an unicorn. Later on, one of the policemen who has asked Deckard to take on the assignment, and who has a habit of making origami 'doodles', leaves a paper unicorn at Dekkard's appartment, having previously commented, somewhat cryptically, to Dekkard after killing the last rogue replicant that "that's a Man's job you have done". Why would he say that if Deckard wasn't himself a replicant and not a man?