In a massless rope, tension is constant unless a force is applied somewhere along the rope. Why? Because any differential tension would travel at infinite velocity (since speed of wave scales inversely with square root of mass per unit length, and the rope is massless).
The only way to preserve a difference is therefore
- applying a force along the rope (for example, running the rope over a pulley with friction)
- putting some mass at a point along the rope, and accelerating that mass (because a net force is needed to accelerate the mass).
When there is a knot in the rope, there will be friction between parts of the rope and that allows there to be different tension in different parts of the rope; but running the rope over a pulley does not imply that there is differential tension, unless the pulley is massive and accelerating, or unless there is friction.
If you accept that the rope has finite diameter, then bending it in a curve may result in differential stresses along the diameter of the rope (the outside, being stretched more, would be under greater tension) but that depends on an assumption that the rope is solid and of finite size; when ropes are made out of twisted (or woven) filaments, these filaments can slide so as to maintain equal tension is all of them when the rope is bent. This is in fact a key reason for this construction (the other is that this ensures much greater flexibility - the two things go hand in hand).