You can search pretty much whatever you want online -- searching for information is not a crime. But certain searches are monitored and certain words will trigger suspicion and investigations, and if you engage in illegal activity online, that is a crime.
You can search the words "kiddie porn" for example -- how else will you find information on the topic? -- but you absolutely cannot download the stuff. People can and do get arrested for their illegal online activities. But it's important to distinguish between suspicious searches and illegal activities. Googling the word "murder" does not make you a killer, and this principle extends to terror, porn, and more.