This can be addressed by introducing a dummy variable and an interaction term.
Let
$Y = \text{Sales}$
$A = \text{Advertising}$
$X = \left\{
\begin{array}{lr}
1 & \text{if Brand A}\\
0 & \text{if Brand B}
\end{array}
\right.$
So we have continuous outcome $Y$, continuous covariate $A$, and dummy variable $X$.
We wish to determine whether the effect of advertising ($A$) on sales ($Y$) is the same between the two values of $X$. Graphically, this corresponds to the null hypothesis that regression lines for $X=0$ and $X=1$ are parallel.
We can test this hypothesis using the interaction model:
$$Y = \beta_0 + \beta_1 A + \beta_2 X + \beta_3 AX$$
which can also be written as
$$Y = \beta_0 + \beta_1 A + X(\beta_2 + \beta_3 A)$$.
If $X=0$ (Brand B):
$$Y = \beta_0 + \beta_1 A$$
If $X=1$ (Brand A):
$$ \begin{align} Y &= \beta_0 + \beta_1 A + \beta_2 + \beta_3 A\\
&= (\beta_0 + \beta_2) + (\beta_1 + \beta_3) A
\end{align}
$$
Our null hypothesis is that the slopes of the two lines are the same, so
$$\begin{align}
H_0 : \beta_1 &= \beta_1 + \beta_3\\
\Leftrightarrow \beta_3 &= 0
\end{align}$$
This means that to address whether the effect of advertising on sales is the same between brands, we can perform a t-test for $\beta_3$ in the interaction model.