We can cross our fingers and hope that nobody would work with them (I know that Germany's parties all have a pinky promise not to work with AfD), but it was only 10 years ago that everyone in the US was laughing at the prospect of a Donald Trump presidency – and now here we are, much sobered. These things happen, and AfD, or RN, or whoever, could wreak havoc to the EU from within the EU if they took power and started working with Hungary to block EU legislation, veto sanctions, defund programs and more.
Except the Swiss.