What is confusing you seems to be the rope-pulley component itself. When you have a set-up like this, it is equivalent to draw it without the pulley. Imagine instead that the same masses were attached to each other via a massless horizontal adamantium bar. Then imagine there is a force pulling $m_1$ to the left by $m_1g$ and pulling $m_2$ to the right by $m_2g$. Now how does the system react? Clearly, this would be the same as if the two masses were combined and you had the same forces:
$$F_{net}=(m_2-m_1)g\\
a=\frac{m_2-m_1}{m_2+m_1}g$$
When using the rope and pulley, tension does the same thing. To keep the two masses the same distance apart and to uphold Newton's Third Law, the rope must apply the same tension force on both ends. Let's get that force from the horizontal bar model: We know the net acceleration of the system, which means the left side of the bar must pull $m_1$ with a force strong enough to overcome the leftward gravity and accelerate it rightwards
$$F_{net}=T-F_g\rightarrow T=m_1g+m_1a$$
We also know the right side of the bar must apply a force to the left to cancel the rightward force on $m_2$ just enough so it accelerates at $a$
$$F_{net}=F_g-T\rightarrow T=m_2g-m_2a$$
Plug in the value for $a$ we found above and lo you find the T's are equal! Not surprising since that was a necessary outcome. But this is the same as the Atwood machine. Note though, that the Tensions aren't equal to the force of gravity on each mass because the system is accelerating. In this case, the true scope of Newton's Third Law is upheld because while the masses accelerate toward Earth, Earth imperceptibly accelerates towards the masses.
Say you have a weight tied to each side a a rope which is strung over a pulley with friction. Here's a really easy way to see why the tensions on each side of the rope can't be equal.
Imagine a really stiff pulley - in other words, ${\bf F}_\text{friction}$ is high. If that's the case, it'll be possible to balance unequal loads on this pulley system - i.e. a heavy weight on the right side and a lighter weight on th left - without the system moving. If the weights don't move, then we can say that the forces acting on each weight add up to zero:
For the heavy weight, there's the weight downward, ${\bf w}_\text{heavy}$ and there's the tension of the right side of the rope upward, ${\bf T}_\text{right}$. The tension pulls up and the weight down, and the system doesn't move, so
$$ {\bf T}_\text{right} - {\bf w}_\text{heavy} = 0
$$
or
$$ {\bf T}_\text{right} = {\bf w}_\text{heavy}
$$
Similarly for the left (light) side,
$$ {\bf T}_\text{left} - {\bf w}_\text{light} = 0 \quad \Rightarrow \quad{\bf T}_\text{left} = {\bf w}_\text{light}
$$
As you can see, the tension on the right, ${\bf T}_\text{right}$ is equal in magnitude to the heavy weight, while the tension on the left, ${\bf T}_\text{left}$ is equal to that of the lighter weight. The friction is introducing an extra force which changes the tensions on each side.
As far as your question about rope stretching goes, if you anchor a rope on one side and pull, the rope will pull back, creating a tension. This is indeed because of stretching in the rope. This is not really what Newton's 3rd law is referring to. Newton's third law, in this case, tells us that the force that we feel from the rope, tension, is exactly the force the rope feels from us pulling. The two are equal and opposite. You can change the tension by changing the stiffness of the rope, but whatever the tension, Newton's 3rd law will still be true - the rope will feel us pulling it as much as we feel it pulling us.
Best Answer
If you and your friend are interacting, when he pulls you, he will feel that you apply to him the same force as he applies to you. If both of you are in vacuum and no further forces are present, the change in momentum will be equal for both of you. If further forces like friction are present, then the total forces acting on each of you might differ. But the parts which come due to you two interacting with each other will still be equal.
In the rope example there are two things playing a role and they should be kept apart:
While the first point is always true, the second one doesn't have to be true, say, if the rope and the weight are in a free fall accelerating towards the earth, rather than in an equilibrium situation. Obviously, there will be no tension force in case that the second point is not given.