Does energy of explosion channelise? Whenever there is an explosion inside a barrel of a gun, the bullet shoots off with the energy of explosion. My question is: 
Suppose $E$ amount of energy is liberated from explosion. Then, does the bullet use almost all of this energy or only a fraction of it, as the rest of the energy goes into pushing against the walls of the barrel which is then just wasted as vibrational energy and then eventually into heat. I mean, does this mean that the bullet starts off with only,say, 1/6 of the total energy of explosion (considering the barrel to be cubical for over simplification).
 A: When the propellant explodes it creates a hot high pressure gas, and the pressure of this gas pushes the bullet along the barrel.

The energy of the bullet is equal to the work done on it, so the energy at some distance $d$ along the barrel will be:
$$ E = \tfrac{1}{2}mv^2 = A \int_0^d P(x)\,dx $$
where $A$ is the area of the bullet, though actually calculating the integral will be hard. The propellant does not burn instantly so the pressure is some complicated function of time as well as distance moved by the bullet. There will also be some frictional term to subtract from that energy, though this is likely to be a small correction.
You ask:

as the rest of the energy goes into pushing against the walls of the barrel which is then just wasted as vibrational energy and then eventually into heat

but the gas does no work on the walls of the barrel so no energy is lost that way. However there will be some heat loss into the walls of the barrel and that will cool the gas, lower its pressure and reduce the amount of work that can be done on the bullet. However the duration of the bullet's travel down the barrel is very short, so there probably isn't much heat lost this way. Most of the energy will go into kinetic energy of the bullet.
