Switch mode power supply connected to the diesel generator makes bad voltage oscillation
Sounds like you may be violating the Middlebrook criterion:  If the output impedance of the generator combined with the input filter is less than the input impedance of the power supply AT ANY FREQUENCY the combination can become unstable.  It works when connected directly to the mains because the impedance of the normal AC supply is likely lower than the generator.  You could do some analysis to see if there's any way to reduce the impedance connected to the power supply by modifying the filter.