I really think every question should be regarded per default as someone with an innocent mind who simply wants to know an answer until the intent to circumvent the law is glaringly obvious. There are several reasons for this:
a) Different, sometimes even inscrutable laws. What in one country is really a completely innocent gesture is a felony in another country. Simple example: During the times the former Eastern bloc existed, taking even small change in the countries own currency with you over the border (simply a souvenir) was punished as felony. InsultAdding insult to insuryinjury, the stuff was worthless anyway. Indian and chineseChinese people often use herbal medicine and could get convicted if they travel to the USA and the stuff they have as medicine is on the DEA list. So, as mindcorrosive already said: If they are not obviously illegal like weapons, strong drugs etc., assume that they may be legal in the home country.
b) Even if it seems straightforward as illegal, sometimes telling explicitly that it is illegal should be the right course of action. There are people who are not really asking for information, but for confirmation (of their own viewpoint). For example: Ivory should not be bought as souvenirs according to CITES and some people simply do not want to understand that they should not do this. If the read it in black and white, they cannot dodge it or pretend that they did not know what they do.
c) Sometimes even illegal things must be considered for the travellers best interest. We had this ugly "forced marriage" thread where the question was how to get her out of the situation by any probable means possible. Another ugly, but possible situation: What do you do as traveller if your bag is suddenly heavier and you find some neatly packed white powder inside your luggage and you are in a third-world country with capital punishments for drug possession ? You see, even "illegal" questions may have their place.