After some more digging, i found out that you can mark a module as unsafe with dnlib with the following code:
ModuleDefMD module = ModuleDefMD.Load("theModuleYouWantToMarkAsUnsafe.exe");
module.CustomAttributes.Add(new CustomAttribute(new MemberRefUser(module, ".ctor", MethodSig.CreateInstance(module.CorLibTypes.Void), module.CorLibTypes.GetTypeRef("System.Security", "UnverifiableCodeAttribute"))));
I thank very much @Alan for pointing out what attribute is needed for the job !