Does code prohibit using salvaged materials in new electrical work?
As long as the components meet current code they can be reused. For example if I replace all the switches and outlets in a home and the outlets are 3 prong and in good shape I will save them and the switches for small repair jobs. You would think after 35 years of doing this I would have truck loads but I only save the quality parts; backstab only devices usually go in the trash and I use enough for friends etc that I only have a medium box full.

Wire can also be reused but I usually will not save romex under 10 awg and then if only in like new shape. I will regularly save larger thhn/thwn wire and inspect it prior to reusing.

Even breaker panels can be reused if they meet current code but in many cases I save the older quality panels for subs in a pump house or garage because most of the time they are only 60 to 125 amp. With all the new AFCI and GFCI requirements I prefer getting larger panels for a home.