The air inside a plane gets continually recirculated and some people have such a severe allergy that even the smallest traces can causes a bad reaction.
Yes, a simple dusk filter would prevent peanut dust from being inhaled. If it gets on their skin though I don't know how someone normally reacts. May be too small to cause an issue or who knows?
Peanut dust isn't airborne for any significant amount of time nor does it seem to be capable of causing any reactions even at the dust levels detecting right where someone is eating a peanut: https://www.aaaai.org/ask-the-expert/peanut-air-travel