Can one make a house out of sand. The ability to transform and manipulate elements of nature is constrained by the laws of nature themselves. Thus while one can mould and bake soft clay into hard bricks and make a house of this clay, the same can't be done for sand. Snake is like sand and wolf is like clay if you understand the analogy.
I am a scientist, my work involves logic.
This is patently false.
http://us.whales.org/whales-and-dolphins/brain-power
But that is irrelevant.
The genes in the neurons of the brain of the whale are shaped by evolution to create this instinct in them. Just as different genes develop different neurons in a spider that creates the instinct that causes them to make webs. Similar instincts exist in us of course. The love a mother feels for her child is a great example of an instinct created by the laws of evolution.
Migratory species have special senses that help them keep track of direction, another ability that they have through evolution.
http://www.sciencefocus.com/qa/how-do-animals-know-where-migrate
The laws of evolution are responsible for the form and behavior of all life. Evolution creates and transforms genes. Genes dictate what proteins and enzymes are formed and when. Proteins and enzymes make up and determine the form and function of the entire body and all its organs including the activity of the brain. And so it is that evolution causes animals to act and react the way they do. What they do determine how many offsprings they have. These offsprings pass on the genes with small modifications, thus creating variability. This variability determines which offsprings are more successful in their turn to have more children. Thus the genes change, animals change and evolution continues. A vast iterative loop that hones and rehones living things through the eons of the world.
Just as pretexts to believe in such ideas...