Yes, you can put an extension cord behind a wall. However, it is important to ensure that the cord is properly secured not to become tangled or create a tripping hazard. You should also avoid running the cord across doorways or in high-traffic areas.