There is no definitive answer to this question since the legality of getting free in app purchases can vary from country to country. However, in general, it is not illegal to get free in app purchases as long as you are not violating any terms and conditions set by the app developer.