The mechanism for salmon natal homing isn't exactly known, but there are really two good hypotheses out there.
- Salmon have an extremely good sense of smell. One hypothesis is that they retain an imprint of their birthplace's odor, and manage to recognize it again at a later time (as explained by this article).
- Another hypothesis: the Earth's magnetic field guides the salmon to their birthplace via geomagnetic navigation. They then use chemical cues to recognize the stream in which they were born (supported by this scientific article).
These hypotheses were mentioned in this Wikipedia article. Note that there was a third pheromone-related hypothesis which was disproved (as shown here).
I would say that both memory and "genetic conditioning" could potentially be factors in how these animals perform this natal homing, among other things. However, it is difficult to pinpoint which one if any, because neither hypothesis has yet to be confirmed, and both function on completely different mechanisms. Not to mention that we can't tell what exactly a fish is thinking, and also what chemical we're looking for, if there is one.
Finally, for your personal information, salmon aren't the only animals to do this: sea turtles return to their birthplace as well.
TLDR: If a salmon was displaced right before birth, or birthed in a pool, I would imagine it returning to that particular location at sexual maturity.
Lohmann, K. J., N. F. Putman, and C. M. F. Lohmann. “Movement Ecology Special Feature: Geomagnetic Imprinting: A Unifying Hypothesis of Long-distance Natal Homing in Salmon and Sea Turtles.” Proceedings of the National Academy of Sciences 105, no. 49 (December 5, 2008): 19096–19101.
Dittman, A., and T. Quinn. “Homing in Pacific Salmon: Mechanisms and Ecological Basis.” Journal of Experimental Biology 199, no. 1 (January 1, 1996): 83–91.
Black, Geoff, and J. Dempson. “A Test of the Hypothesis of Pheromone Attraction in Salmonid Migration.” Environmental Biology of Fishes 15, no. 3 (1986): 229–235.