Suppose you have one arithmetic progression $a+mc$ and another $b+nd$ where $a,b$ are the sequences' initial terms, $m,n$ are the indices of the sequences, and $c,d$ are the differences of the sequences respectively. To simplify notation, I will treat sequences as starting from index zero, but this is easily adjusted if you insist on sequences starting from index 1.
I assume that by "first term common to both" you do not require that their index be the same in each sequence, that you are instead simply looking for the smallest term which occurs in both sequences at some point but not necessarily at the same index.
Now... the terms which occur in the first progression are all $a$ more than some integer multiple of $c$. Written in terms of modular equivalences, that would be that if $x$ is some term in the first sequence we have that $x\equiv a\pmod{c}$. Similarly, if $x$ were also in the second sequence we would have $x\equiv b\pmod{d}$
So, our task is to solve the simultaneous set of equivalencies $\begin{cases}x\equiv a\pmod{c}\\x\equiv b\pmod{d}\end{cases}$ for the smallest $x$ which is greater than equal to both $a$ and $b$.
This is precisely the type of problem that the Chinese Remainder Theorem is meant to solve.
Note that it might not be possible to find a solution for certain $a,b,c,d$ in the case that $\gcd(c,d)>1$. For instance the arithmetic progressions $2m$ and $1+2n$ generate the even numbers and odd numbers respectively... there is no overlap.
In the case of $\gcd(c,d)=1$ we can via the Extended Euclidean Algorithm find the coefficients $j,k$ for Bézout's Identity satisfying $jc+kd=1$ which are guaranteed to exist.
Armed with this knowledge, letting $x\equiv bjc+akd\pmod{cd}$, we can see then that $x\equiv a\pmod{c}$ since $bjc+akd\equiv 0+akd\equiv ajc+akd\equiv a(jc+kd)\equiv a(1)\equiv a\pmod{c}$. Similarly, we see that this choice of $x$ satisfies $x\equiv b\pmod{d}$.
Now, all that remains is to find the smallest such $x$ which is simultaneously greater than or equal to $a$ and $b$.
Adjusting this to allow for $c,d$ which are not coprime follows similar principles but the value of $\gcd(c,d)$ appears in more calculations. Follow the link to see how it changes.
As for your specific example, we have the sequences $3+4m$ and $2+7n$.
We see that $\gcd(4,7)=1=2\cdot 4 + (-1)\cdot 7$
We see then that the numbers common to both are of the form $x\equiv 2\cdot 2\cdot 4 + 3\cdot (-1)\cdot 7\pmod{4\cdot 7}$, or simplifying $x\equiv 16 -21\equiv -5\equiv 23\pmod{28}$
That is to say, the numbers which are common to both sequences are $23,23+28,23+2\cdot 28, 23+3\cdot 28,23+4\cdot 28,\dots$ or otherwise written $23,51,79,107,\dots$
The smallest of which which is larger than both $a$ and $b$ (larger than $3$ and $2$) is $23$ itself.