Hello and Good Afternoon,
Thank you for asking this question about the usage of 'in bocca al lupo'.
According to Dizionario dei modi di dire della lingua italiana (Garzanti), the use of this phase originated with hunters wishing each other to be in dangerous situations, similar to what we use in the English language commonly referred to as 'break a leg'. BTW .... If any one were to say this to you, your response should be either 'crepi il lupo' or simply 'crepi'.
Thank you again for allowing me to answer this question. Please let me know if you have any additional questions or if you want to get a better sense of the Italian language.