AfD is (like BSW) extremely anti-Ukraine. Seriously, the party boss just called for recognizing Russia’s victory. That‘s the big divider, on immigration issues they could find common ground.
I'm not German, but it seems to me that CDU could capitulate on immigration in exchange for a change in AfD party policy on the Ukraine war. I doubt there are that many hardcore pro-Russian voters (although who knows with the East Germans).