Extension cords that are along the walls are safe as long as they don't extend out to the floor. If an extension cord is lying on the floor, it's too easy for a person who isn't paying attention to trip over it. Keep these cords off the floor as much as possible and use cones or signs to alert people to the presence of the cord if you have to temporarily place a cord on the floor.
Don't run extension cords through holes in the wall and then along the wall. Running a cord through the hole puts the cord in danger of being pinched, which can damage the cord. If the hole pinches the cord to the point where the cord starts to fray or you can see the internal wiring of the cord, it won't be safe to use anymore and will have to be discarded.
Squashing, folding or bunching cords to get them to stay along the wall instead of going out to the floor is dangerous. Bunched or folded cords tend to overheat. If the extension cord overheats, it can set the wall or any flammable material on the wall on fire. Always give extension cords space to breathe if you place them along walls.
Extension cords are meant to run appliances on a temporary basis. You can run the cord along the outside of the wall (but usually not inside the wall or behind it), but don't use the extension cord to run heavy duty or permanent appliances such as refrigerators. These types of appliances can easily overload the extension cord and cause you to lose power or cause the cord to overheat.