The movie Willie Wonka and the Chocolate Factory came out in 1971. The late 1960s to early 1970s was the height of the psychedelic era, when a LOT of people were doing acid, magic mushrooms, peyote, and other hallucinogens. Some parts of the film -- especially the boat ride -- do have a noticeable psychedelic feel to them.
However, the novel that the movie was based on (Charlie and the Chocolate Factory) was first published in 1964, when the psychedelic era was just getting started. Its author, Roald Dahl, was not a drug user (that I am aware of, anyway). I haven't read the book since I was a kid, but I do not remember the book having any kind of psychedelic flavor to it.
In short, the psychedelic undertones are an aspect of the movie...not the book. So, no, the book was not based on an acid trip. That was merely a creative license taken by the moviemakers.