Like you said, it's a fairly natural phenomena. Any clash in cultures, nationalities, religions, etc will result in some unrest. How far that unrest goes is obviously... challenging to predict. There's too many factors involved, but a lot of these factors are within society's control. I've said this before, but I think the open border that Germany forced upon her members was a mistake, but not because of the unrest that followed. Government services clearly were not ready to handle such a large number of refugees. A lot of the violence, unrest, and crime that follow is preventable imo. A much larger effort should've been placed on both integrating and isolating the people who came.
Aside from the refugee problem, there were discussion of how poorly Turks and similar Muslim minorities integrate into German/European society. Again, I don't think that's a positive thing. There's always a reasonable compromise between family values and modern society to be found provided the people want it. It's a question of effort. However, I think that criticism of affirmative action on their effectiveness, while warranted, goes in the wrong direction. Often times the poor integration of minorities leads to people wanting to either cut these programs off because they're a waste of money in their eyes, or to kick out the minorities in question. As you mentioned in the early 20th century, we had a similar problem.
I think history has shown us that even if we do pretty much nothing about the problem, things will eventually get better. The wealth of experience and the sheer fact that we are far more educated and equipped on how to handle immigrants can allows us to devise affirmative action that will encourage people to integrate into society. In terms of how to punish refugee crime, I think the question should be whether the crime in question was committed out of desperation, such as stealing food, or maliciousness. I think the questions of how to punish crime shouldn't be all that complicated. People should be treated equally, regardless of their refugee status or ethnicity. On other compounding issues, like refugees lying about their age, I have no answer. The entire refugee/immigrant question is a complicated situation that requires a fairly complicated, multi part solution.
To summarize, affirmative action, patience, and equal treatment is the only way to deal with foreign cultures. There are exceptions of course, especially somewhere like Israel who will be a minority in their own country if they follow similar "liberal" policies in regards to Palestinians. The reality on the ground there has to contend with cold pragmatism. However, Western countries do not face that situation. We can afford to be patient and tolerate a marginal increase in crime. Diversity and multiculturalism makes a country stronger in my opinion as "identity" tends to be stronger than ethnicity.
.