The invention relates to the field of thermoplastic elastomers, and discloses a halogen-free flame-retardant nitrile rubber/nylon thermoplastic elastomer and a preparation method thereof, wherein thethermoplastic elastomer contains a nitrile rubber, nylon, a flame retardant, a vulcanizing agent, an anti-aging agent, an antioxidant and an auxiliary agent, the vulcanizing agent is an organic peroxide, and the organic peroxide is at least one selected from dicumyl peroxide, bis(t-butylperoxyisopropyl)benzene, t-butyl cumene peroxide, 2,5-bis(t-butyl peroxy)-2,5-dimethyl-3-hexyne, 2,5-bis-(tert-butyl peroxy)-2,5-dimethyl hexane, dibenzoyl peroxide, tert-butyl peroxybenzoate, and di-tert-butyl peroxide. According to the present invention, the nitrile rubber/nylon thermoplastic elastomer has characteristics of high elasticity, easy processing, repeated processing, good flame retardant performance and the like, and can be used for vehicle oil pipelines and sealing members.