Joule's law of heating states that an accelerated electron loses its energy, which is then converted into heat energy, by colliding with vibrating atom i.e ions in their lattice site. but we know atom consist of electrons and a nucleus. Where does it collide? How does energy get transferred?
That's a very hard question to answer with the appropriate level of detail! Very broadly speaking in an ideal metal all atoms are forming a perfectly regular crystal lattice. Conduction band electrons can move freely around these atoms, which makes it easy to pass a current trough the metal.
In a (theoretical) metal with perfect crystal lattice the electrons wouldn't be losing any energy and the metal would behave similar to a superconductor. However, in reality metals are never ideal, they have so called defects. A defect is a place in the lattice where an atom is missing or where it's sitting in the wrong position, or there could be an atom of a different element replacing one of the metal's own.
When electrons pass such a defect, they encounter a discontinuity and get deflected from their ideal path. This can only happen if the momentum of the electrons change and because of momentum conservation that has to change the momentum of the atoms around the defect. The momentum change also transfers kinetic energy from the electrons to the metal lattice, which is the heat that is generated when a current flows trough a conductor.
In reality these processes have to be described with quantum mechanics and that's so complicated that we are still researching many of these phenomena (although simple resistive Joule heating is understood fairly well).
Joule's law, and thermodynamics in general, is a model of the classical world. Here, classical should be interpreted as non-quantum-mechanical. Thermodynamics is the study of large collections of particles and their collective behavior. No microscopic model is assumed, and one tries to extract as many (non-trivial) features as possible based on purely macroscopic parameters. Of course, thermodynamics can be given a more fundamental foundation by studying statistical mechanics. Classical statistical mechanics gives a better justification for many thermodynamic laws (which were often determined semi-empirically rather than derived from 'first' principles).
However, to get a really good explanation of how exactly energy is transferred between particles, one has to go into quantum mechanics (or even quantum field theory, in many cases). This has the advantage of telling you 'what's really going on', but there is a major drawback: Macroscopic laws like Joule's law and the rest of thermodynamics become obscured, and it is not trivial to recover these things from the quantum theory. Thus, depending on what exactly one is interested in knowing, it is important to choose the right 'level' to investigate: Classical or quantum?