Why conservation of momentum? 
A bullet of mass 20 g travelling horizontally with a speed of 500 m/s passes through the wooden block of mass 10 kg initially at rest . The bullet emerges with a speed 100 m/s and the block slides 20 cm before coming to rest. Find friction coefficient between block and surface


My teacher solved this question by conserving momentum between the bullet and the block. But how can he do that when there is external force (friction) acting on the system? I think impulse momentum theorem is used in such scenarios, but how can I apply it in this problem?
 A: You are right: you should treat the momentum transfer as an impulse.  Assume that the bullet takes no time at all to get through the block, and that the momentum it loses is transferred instantaneously to the block.  Then, you need to solve the rest of the problem.  
The way I would approach the rest of the problem is to use the block's instantaneous momentum to and mass to calculate how much kinetic energy was transferred to the block, and then calculate the coefficient of friction.  Force x distance = work, which = the energy the block got from the bullet; and force in this case is the coefficient of friction times the * weight* of the block.  (Make sure you don't mistake the mass for the weight!)
A: What if the friction force was not external?
If you consider the system {Bullet + Block + Ground} then you have three phases:


*

*Phase 1: The bullet has kinetic energy, block and ground are at rest.

*Phase 2: The bullet has lost some kinetic energy, which has been transfered to the block as kinetic energy

*Phase 3: The block has lost energy. It has been transfered as heat to the ground. Knowing the initial energy, and the distance it took to dissipate it, you can calculate the coeffcient.
A: 
Whenever two or more particles in an isolated system interact, the total
momentum of the system remains constant.

The momentum of the system is conserved, but the momentum of the individual particle may not necessarily conserved.
The total momentum of an isolated system equals its initial momentum.
So here in your set-up, the system of block +bullet is the system.
one knows for certain that part of the energy of bullet must have been lost.
therefore energy conservation cannot be applied.
Therefore limit yourself to the momentum conservation.

I think the impulse-momentum theorem is used in such scenarios but how can I apply it in this problem?

From Newton’s Second Law
dp/dt = F   or
dp = Fdt
By integration, we can find the change in momentum over some time interval say dt.The integral is called the impulse (I ) of the force F acting on an object over the time dt.
The impulse imparted to a particle by a force is equal to the change in the momentum of the particle (impulse-momentum theorem).
Your momentum conservation is related to Impulse given by the block to the bullet and bullet providing an impulse to the block. And both are equal.
A: Probably your teacher assumed that the motion of the bullet and block could be separated into two phases :


*

*The bullet "collides" with the block instantaneously. It passes through the block and transfers most of its momentum to the block in such a short time $\Delta t$ that the block does not have time to move. The impulse $F\Delta t$ due to the friction force between the block and the horizontal surface is therefore negligible. Unlike normal contact force between rigid bodies, which can reach around $1GPa$ for wood, the friction force $F$ has a small upper limit. In this Phase Conservation of Momentum is applied to find the initial velocity of the block.

*The block slides along the rough horizontal surface, doing work against friction and gradually losing its initial kinetic energy. This takes a finite time. In this Phase the momentum of the block is eliminated by friction, and the Conservation of Energy (or the Work-Energy Theorem) is applied to find the work done against friction.
The purpose of splitting the problem into 2 separate phases is that it makes the analysis much easier. Two different principles apply in each phase, and the result of phase 1 provides the initial conditions for phase 2. Any complicated interaction between the two phases is ignored. 
The key assumption is that it makes no difference (or no significant difference) if the bullet takes a finite time to pass through the block, and is still transferring momentum to the block while the block is moving. 
This assumption is justified if the work done against the external force (friction) is the same whether or not Phase 1 is instantaneous or overlaps with Phase 2. Provided that the bullet emerges from the block before it stops and that its loss of momentum is known, the total amount of momentum transferred from the bullet to the block and then to the Earth via friction is the same in both cases.  
Kinetic friction is usually assumed to be independent of the relative velocity between the surfaces, so the manner in which the speed of the block varies is irrelevant. However, friction does depend on the total mass of the block, so the work done against friction over a fixed distance is greater the longer the bullet remains inside the block. This effect will be negligible if the mass of the bullet is much lighter than that of the block.
The time taken for the bullet to pass through the block, and the manner in which the resistance force on it varies, are irrelevant because the total amount of momentum which is transferred from the bullet to the block is defined by the problem.

Another situation in which an external force acts for a finite time during a collision is when the colliding objects are falling in a gravitational field.
Related question : Can linear momentum be conserved before and after collision in the presence of an external force?
A: The teacher is assuming that the bullet passes through instantaneously. In other words, the bullet moves so quickly that there is no time for friction to act. Hence, the momentum that the bullet loses is entirely transferred to the block, and none is transferred to the ground via friction.
An appropriate follow-up question would be, is this a reasonable assumption to make? Let's take friction into account and try to estimate how fast the block would actually be moving when the bullet exits.
We know the bullet is traveling at $\frac{500\text{ m/s}+100\text{ m/s}}{2}\approx300\text{ m/s}$ on average through the block. If the block is wood and cubic in shape, then the block is only ~0.3 m wide.* Hence, the bullet would pass through the block in a time of:
$$t=\frac{d}{v}=\frac{0.3\text{ m}}{300\text{ m/s}}=0.001\text{ s}$$
Your teacher calculated that the block reaches a speed of 0.8 m/s as a result of the collision with the bullet. That's a high estimate, because it ignores friction with the ground, which slows the block. But let's go ahead and assume that, while the bullet is in the block, the block's average speed is $\frac{0+0.8\text{ m/s}}{2}\approx0.4\text{ m/s}$. At this speed, and for a time of 0.001 s, the block would only travel a distance of
$$d=vt=(0.4\text{ m/s})(0.001\text{ s})=0.0004\text{ m}$$
while in contact with the bullet. If the coefficient of friction is ~0.16, and if we use $g=10\text{ m/s}^2$, then the block's final speed when the bullet exits would be:
$$\Delta KE=Fd\cos(180°)=(-0.16*100\text{ N}*0.0004\text{ m})=-0.0064 \text{ J}$$
$$\Delta KE=\frac{1}{2}mv_f^2-\frac{1}{2}mv_i^2$$
$$-0.0064\text{ J}=\frac{1}{2}(10\text{ kg})(v_f^2-(0.8\text{ m/s})^2)$$
$$v_f\approx0.799\text{ m/s}$$
There are plenty of things wrong with this calculation (for example, I'm assuming the block immediately reaches a max speed of 0.8 m/s upon collision with the bullet, which isn't true). But as an order of magnitude estimate, it's reasonable enough to show that friction doesn't have much impact on the block while the bullet is inside.
*The density of wood is ~500 kg/m3, so $l=V^{1/3}=(\frac{m}{\rho})^{1/3}=(\frac{10\text{ kg}}{500\text{ kg/m}^3})^{1/3}\approx0.3$.
