We know a magnet has field with direction from North to South. Why when a piece of iron come close to the magnet can either be attracted and from both sites and not for example from one pole?
This is because the iron becomes magnetized. You can imagine the piece of iron as being made up of many tiny little magnets (domains) in random directions such that in the absence of an external magnetic field, all those little magnets cancel each other out. When the iron is placed close to the magnet the little magnets aka 'domains' align with the external field in such a way that the poles of the iron are attracted to the poles of the magnet. If the external field is flipped, the domains are flipped. So it doesn't really matter how the iron is oriented, ultimately the domains in the iron will arrange themselves so that the iron is attracted to the magnet. This is a property of ferromagnetic materials