the second reich was the holy roman empire, that is the empire of charlemagne, which became the hapsburg empire until it was dissolved by napoleon in 1806.
the third reich was the comparatively short lived nazi empire, which was in fact actually geo-politically aligned with major muslim regions like iran and saudi arabia. north africa was a somewhat forgotten but major theatre of operations in world war two. iran was invaded by a joint british-soviet force in world war two to stop the nazis from being invited in (and causing problems in india or the caucasus). the saudis, palestinians and other groups were aligned with germany as a counter to what they saw as british colonialism, and out of a shared opposition to zionism. the fact that the arabs lost world war two, as explicit german allies, is of some importance in the development of events that led to the re-establishment of a jewish state in historical israel.
there was absolutely no persecution of muslim or arabs by nazis in nazi controlled areas from 1933-1945 and turks were seen as german allies, rather than foreigners. the groups targeted by nazis actually included many of the groups that were persecuted by the ottomans, including ethnic greeks, ethnic croatians, hungarians, poles and slavic-speaking groups in general. the jewish holocaust was modeled after the continuing armenian genocide. the actual thing that the nazis were actually doing as step one in the goal to take over the world was trying to wipe out the slavs, to enslave the jews and to abolish communism. muslims and arabs were variably seen as irrelevant or as allies in this task, and large amounts of nazi policy was emulating recent events in the country of turkey and the previous ottomon empire.
it's up to the german people to decide whether they're in favour of more or less muslim immigration, but the historical nazi party and the historical german far right would not have supported or aligned with the afd on this issue. on the issue of islam and the political persecution of muslims, the historical nazi party and it's officials like hitler and goebbels would have sounded more like modern "liberals", and been in favour of tolerance and integration.
one of the explicit arguments made by the nazis was that they should replace the british as the occupying power in the middle east because nazism was more similar to islamic law than british parliamentary democracy, and the arabs would not react as negatively to authoritarian nazism as they reacted to representative democracy. and they had a coherent point to make, on that concern.
the afd - like the french national rally - seems to be more akin to the historical left than the historical right and that is probably the actual reason it's being attacked by the european mainstream. it's probably not a coincidence that this district is east german, and previously communist. and what voters are probably looking for is a social democratic party that hasn't been corrupted by neo-liberalism. the technocrats in the eu consider that to be public enemy #1, so they're attacked as nazis, despite being almost diametrically the opposite thing, politically.
that doesn't mean that there aren't good reasons to oppose the afd. but this conflation of being critical of islam or seeking less migration from muslim societies with the historical german right is exceedingly counter-factual. it's dead wrong, it's actually backwards (those are positions that were held by the historical left, due to slavic nationalism often defining itself in opposition to turkish colonialism), and it should stop.