Short answer.
In your example, the rope can not be massless (otherwise its acceleration would be infinite), but if it has mass, then tension is different on each point of the rope. Therefore you have to assume there is an object connected to it. Depending on which side of the rope you assume the object is, you get tension 20N or 30N.
This does not contradict the vertically lifted object by a rope. In that case the acceleration would be $a=\frac{T-w}{m}=\frac{T-mg}{m}$, that is $ma=T-mg$, that is $T=ma+mg$. What you are missing is that in this case $mg$ is the weight of the object, which does not affect the tug of war case (since its horizontal).
Long answer
Tug of war
If you pull the leftmost piece with 20N and rightmost with 30N, you would get 10N on a 0 mass object, meaning infinite acceleration. Therefore you have to assume there are two bodies (actually only one would be enough). So, one person pulling on each side of the rope.
Assuming the rope is massless, and is consisted of lots of tiny pieces, we can see that each tiny piece has two forces on it. $F_l$ from the left and $F_r$ from the right. Since acceleration of each tiny piece is $a=\frac{F_r-F_l}{m}$ and m->0 then $F_r$ = $F_l$, otherwise $a$ would be infinite.
Also, this means that any piece of the rope, including the ones that connect to the bodies, pull adjacent pieces with the same force. That is, body A and body B are both pulled by the rope with the same force $T$, which is the tension.
There is $F_A=20N$ on the left body and $F_B=30N$ on the right, plus $T$ and $-T$ respectively. Since bodies A, B and the rope have the same acceleration (if they didn't, they'd move apart from each other), we get:
$a=\frac{T-F_A}{m_A}=\frac{F_B-T}{m_B}$ , meaning $T=\frac{m_AF_B+m_BF_A}{m_A+m_B}$.
If $m_B$->0 then $F_B-T=0$, and $T=F_B=30N$. Likewise if $m_A$->0 then $T=F_A=20N$.
You can not assume that $m_B=m_A=0$ without $F_A=F_B$, therefore you need at least one non 0 mass object attached to the rope.
Upwards pulling
If $m_B=0$ then you get the same result as the vertically pulled body, excluding the weight $w$ of the object ($w=mg$), because when pulling horizontally its weight has no effect.
What is important for tidal forces is not the absolute gravity, but the differential gravity across the planet, that is, how different is the force of gravity at a point on the Earth's surface near the sun relative to a point on the Earth's surface far from the sun. If you compare it with the moon, the result will be that the tidal force from the sun is about 0.43 that of the moon.
Suppose two different bodies in the sky that have the same apparent size. Because the mass M of the object will grow as $r^3$ (because $M=4/3\rho\pi R^3$ and $R=\theta r$), the gravitational force will actually grow linearly with $r$, where $r$ is the distance and $R$ is the radius of the object. So if two bodies have the same apparent size (such as the Moon and the Sun) and the same density, the tidal force would be the same. The density of the moon is about 2.3 times larger than that of the sun, that is why the tidal force is larger by that factor.
Best Answer
I write this because it is too long for a comment
Situation
You are putting $k$ watts (=joules/second) of kinetic energy into a body. We will show the acceleration decreases with time.
$$E=\frac{1}{2}mv^2$$ so $$v=\sqrt{\frac{2E}{m}}$$ so $$\frac{dv}{dt}=\frac{m}{\sqrt{\frac{2E}m}}\cdot\frac{de}{dt}$$ (I can't be bothered to tidy this up - remember I'm from maths!
Now
Assume $m$ is constant, and $\frac{de}{dt}$ is also constant (call it $k$) (so you are putting in so many watts (=joules/second) of energy). Then $E=tk$ (because it's going up at a constant rate), thus we have:
$$\frac{dv}{dt}=\frac{mk}{\sqrt{\frac{2kt}m}}$$ You can see that as time goes on, $\frac{dv}{dt}$ becomes smaller and smaller. However it still tends towards infinity.
Proof
As you know, I do maths, so I cannot be bothered to simplify this, however I am sure we can both agree it's of the form: $$\frac{dv}{dt}=\frac{c}{t}$$ for some $c$ that I am too lazy to come up with.
This is easy to solve:
We have: $dv=c\frac{1}{t}dt$, so $\int dv=c\frac{1}{t}dt$
evaluating we see $v+C=c\ln|t|$ where $C$ is an abitrary constant, note $t\ge 0$ so we can write $\ln(t)$
We are left with $v=c\ln(t)-C$
It is well known that $$\lim_{t\rightarrow+\infty}(\ln(t))=+\infty$$
So there really is no "terminal velocity" (ignoring relativity of course)