Why work done by a force was taken as dot product between force applied and displacement caused?
Yes. In fact, there could be many forces acting on the body, and the body could be moving along a very complicated path because of all the forces. Each force does work, which is calculated using the standard dot product definition of work. In this process, each force could be doing positive, zero or negative work. The algebraic sum of the works done by all the forces, which we can call the net work, can also be calculated by first finding the net force, and then calculating the work by that net force.The force doesn't have to be the cause of the displacement. The cause is irrelevant for the definition of work.
I'm sure you meant the component of force parallel to the displacement. The force could very well be opposite to the displacement, which was Drakkith's point here:We're interested in the component of force that points in the same direction as the motion