In nature there are mainly four kind of fundamental forces,electromagnetic force is one of them which is conservative force.If friction force is belongs to electromagnetic force then why it is not conservative force ?
The force of friction is a macro force which describes the actions of many smaller forces.
These smaller forces are the electromagnetic interactions between the molecules, and these forces ARE conservative. However if you had a piece of graphite that was 12g, there would be 602 trillion trillion trillion (6.02 * 10^23) atoms. Even though only a small fraction of these would be the ones touching the other surface, there is still way to many individual interactions to calculate.
In these individual interactions the force is not in the same direction for each atom, so individually the atoms will instead begin to vibrate in random directions. There is energy in these vibrations, so the work done increases the vibrations of the atoms, and we call this heat.
However, if you summed up all the forces on all the atoms, you would find that there is a force which resists the motion of the collection of atoms as a whole. This force appears to be non-conservative because the random vibrations of the atoms cannot be converted back into a velocity going in the same direction, which would result in the collection increasing its speed.
The friction force is an effective force. It emerges when one considers the effect of a surface on a body which is sliding on it. The back-reaction of the body on the surface is usually not taken into account. The missing energy is transfered to the surface as heat.
Even though it is a consequence of the electromagnetic interaction of the body and the surface, the friction force is a "best guess" to what the effective force actually is. Such an approximation actually works really well. You can expect it to break down (for example) when the body is very small compared to the roughness of the surface, or when the the body is sliding very fast and the surface does not have time to absorb the heat originating from the friction.
Note that in order to make predictions, you first have to measure the friction coefficient. In principle it is possible to compute it from first principles, but this is typically very hard to do.