You cannot apply the formula
$$[G \bullet M]_t = \int_0^t G_s^2 \, d[M]_s \tag{1}$$
because the Ornstein-Uhlenbeck process $X$ is not of the form
$$X_t = (G \bullet B)_t,$$
but of the form $$X_t = (G_t \bullet B)_t$$ and -as your calculation show- we cannot expect that $(1)$ extends to this larger class of processes. The reason is, roughly, that $dt$-terms need a different compensation than $dB_t$-terms - and if you shift the multiplicative $dt$-term under the stochastic integral, then you pretend that it behaves, in some sense, like a $dB_t$-term ... but it doesn't.
The proper way is the following:
- Define $$Y_t := \int_0^t e^{\alpha s} \, dB_s.$$ Calculate $[Y]_t$ (that you can do using $(1)$.)
- Apply Itô's formula to find the stochastic differential $$d(X_t^2) = \sigma^2 d(e^{-2\alpha t} Y_t^2).$$
- The $dt$-term of the stochastic differential $d(X_t^2)$, obtained in step 2, equals the quadratic variation $[X]_t$.
Here is the complete solution to the problem including some special cases for an easy start.
With analogy to the integrating factor method from ODEs it seems natural to rearrange
\begin{align*}
\mathrm{d}X_t = (a(t)X_t+ b(t)) \mathrm{d}t + (g(t)X_t+ h(t))\mathrm{d}B_t
\end{align*}
to the form
\begin{align*}\mathrm{d}X_t - X_t \left( a(t)\mathrm{d}t+g(t)\mathrm{d}B_t\right) = b(t) \mathrm{d}t + h(t)\mathrm{d}B_t .\end{align*}
Now we want to find a "nice" stochastic process $Z_t$ such that
\begin{align*}( \star) \ \ \ \mathrm{d}(X_tZ_t) =& Z_t\mathrm{d}X_t \underbrace{- Z_tX_t \left( a(t)\mathrm{d}t+g(t)\mathrm{d}B_t\right)}_{X_t\mathrm{d}Z_t + \mathrm{d}X_t\mathrm{d}Z_t} \\ =& Z_t(b(t)\mathrm{d}t + h(t)\mathrm{d}B_t).\end{align*}
Assume that $Z_t$ is an Itô process such that
$$\mathrm{d}Z_t = f_1(t, Z_t)\mathrm{d}t + f_2(t, Z_t)\mathrm{d}B_t , \ \ Z_0 = 1.$$
Let us apply Itô's product formula to $\mathrm{d}(X_tZ_t)$ we obtain that
\begin{align*}\mathrm{d}(X_tZ_t) =& Z_t \mathrm{d}X_t + X_t \mathrm{d}Z_t + \mathrm{d}X_t \mathrm{d}Z_t \\ ( \star \star) \ \ \ \ \qquad = & Z_t\mathrm{d}X_t + X_t \left( f_1(t, Z_t)\mathrm{d}t + f_2(t, Z_t)\mathrm{d}B_t \right) + (g(t)X_t + h(t))f_2(t, Z_t) \mathrm{d}t.\end{align*}
Comparing the above with the right hand-side of $(\star)$ we arrive at
\begin{align*}- Z_tX_t \left( a(t)\mathrm{d}t+g(t)\mathrm{d}B_t\right) = X_t \left( f_1(t, Z_t)\mathrm{d}t + f_2(t, Z_t)\mathrm{d}B_t \right) + (g(t)X_t + h(t))f_2(t, Z_t) \mathrm{d}t \end{align*}
and thus
\begin{align*} -Z_tX_tg(t)\mathrm{d}B_t &= X_t f_2(t, Z_t)\mathrm{d}B_t \\
-Z_tX_ta(t)\mathrm{d}t &= \big(X_tf_1(t, Z_t)+(X(t)g(t)+h(t))f_2(t,Z_t)\big)\mathrm{d}t.\end{align*}
From the first equation we can deduce that $f_2(t, Z_t) = -Z_tg(t)$ and so the second one converts to
$$-Z_tX_ta(t)\mathrm{d}t = \big(X_tf_1(t, Z_t)-Z_tg(t)(X(t)g(t)+h(t))\big)\mathrm{d}t,$$
and so
$$ Z_t (-X_ta(t)+X(t)g^2(t)+g(t)h(t)) \mathrm{d}t = X_tf_1(t, Z_t)\mathrm{d}t.$$
Hence,
$$f_1(t, Z_t) = Z_t(-a(t)+g^2(t)+X_t^{-1}g(t)h(t)).$$
However, we want $Z_t$ to be free of $X_t$ for that we consider two cases
CASE 1. $g(t) \neq 0$, $h(t)=0$
Then $Z_t$ would satisfy
$$\mathrm{d}Z_t = Z_t(-a(t)+g^2(t))\mathrm{d}t -Z_t g(t)\mathrm{d}B_t , \ \ Z_0 = 1$$
(We solve the above SDE by a standard trick involving Ito's formula, that is, first we divide by $Z_t$ to obtain the expression for $Z_t^{-1}\mathrm{d}Z_t$ and then derive the expression $\mathrm{d}(\ln(Z_t))$)
and so $$Z_t = \exp\left( \int_0^t\left( \frac{1}{2}g^2(s) - a(s)\right) \mathrm{d}s - \int_0^t g(s)\mathrm{d}B_s\right).$$
This is the integrating factor which you obtained, and it is not the correct one if $h(t) \neq 0$.
If we continue then we obtain
\begin{align*}\mathrm{d}(Z_tX_t) =& Z_tb(t)\mathrm{d}t
\\ Z_tX_t =& X_0 + \int_0^t Z_sb(s) \mathrm{d}s\\
X_t =& X_0Z_t^{-1}+ Z_t^{-1}\int_0^t Z_sb(s) \mathrm{d}s\\
X_t =& \exp\left( \int_0^t\left( a(s) - \frac{1}{2}g^2(s) \right) \mathrm{d}s + \int_0^t g(s)\mathrm{d}B_s\right) \\ &\cdot \left(X_0+ \int_0^{t} b(s)\exp\left( \int_0^s\left( \frac{1}{2}g^2(r) - a(r)\right) \mathrm{d}r - \int_0^s g(r)\mathrm{d}B_r\right)\mathrm{d}s\right).
\end{align*}
CASE 2. $g(t) = 0$, $h(t) \neq 0$
Then $(Z_t)$ satisfies
$$\mathrm{d}Z_t = -a(t)Z_t\mathrm{d}t, \ \quad Z_0 =1 $$
and so
$$Z_t = \exp\left( -\int_0^t a(s)\mathrm{d}s\right).$$
Therefore,
\begin{align*}\mathrm{d}(X_tZ_t) =& Z_tb(t)\mathrm{d}t+ Z_t h(t)\mathrm{d}B_t
\\ X_tZ_t =& X_0 + \int_0^t Z_sb(s) \mathrm{d}s + \int_0^t Z_sb(s) \mathrm{d}B_s\\
X_t = & X_0Z_t^{-1}+ Z_t^{-1}\left( \int_0^t Z_sb(s) \mathrm{d}s + \int_0^t Z_sb(s) \mathrm{d}B_s\right) \\
X_t = & X_0 e^{ \int_0^t a(s)\mathrm{d}s}\\ &+ e^{ \int_0^t a(s)\mathrm{d}s}\left( \int_0^t e^{ -\int_0^s a(r)\mathrm{d}r}b(s) \mathrm{d}s + \int_0^t e^{ -\int_0^s a(r)\mathrm{d}r}b(s) \mathrm{d}B_s\right).
\end{align*}
The general case
So far we were not able to find the solution for the general case, to find it we need to modify and rearrange our initial equation in a slightly different way.
Let write the SDE for $(X_t)$ as follows
\begin{align*}\mathrm{d}X_t = (a(t)X_t + b(t)+g(t)h(t) - g(t)h(t))\mathrm{d}t + (g(t)X_t+h(t))\mathrm{d}B_t
\end{align*}
after rearranging we have
\begin{align*}\mathrm{d}X_t - \left((a(t)X_t+g(t)h(t))\mathrm{d}t+ g(t)X_t\mathrm{d}B_t\right)= (b(t)- g(t)h(t))\mathrm{d}t + h(t)\mathrm{d}B_t
\end{align*}
Now let ($Z_t$) be an Ito process that satisfies
$$\mathrm{d}Z_t = f_1(t, Z_t)\mathrm{d}t + f_2(t, Z_t)\mathrm{d}B_t , \ \ Z_0 = 1.$$
After multiplying our SDE by $Z_t$ we obtain
\begin{align*}Z_t\mathrm{d}X_t - Z_t\left((a(t)X_t+g(t)h(t))\mathrm{d}t+ g(t)X_t\mathrm{d}B_t\right)= Z_t \left((b(t)- g(t)h(t))\mathrm{d}t + h(t)\mathrm{d}B_t\right)
\end{align*}
Applying Ito product formula to $X_tZ_t$ we get
$$ \mathrm{d}(X_tZ_t) = Z_t\mathrm{d}X_t + X_t\mathrm{d}Z_t+ \mathrm{d}X_t\mathrm{d}Z_t,$$
we want to have
\begin{align*}X_t\mathrm{d}Z_t+ \mathrm{d}X_t\mathrm{d}Z_t = - Z_t\left((a(t)X_t+g(t)h(t))\mathrm{d}t+ g(t)X_t\mathrm{d}B_t\right)\end{align*}
The LHS equals to
\begin{align*}X_t\left(f_1(t, Z_t)\mathrm{d}t + f_2(t, Z_t)\mathrm{d}B_t \right)+ (g(t)X_t+h(t))f_2(t, Z_t)\mathrm{d}t.\end{align*}
We compare with the RHS
\begin{align*}X_t\left(f_1(t, Z_t)\mathrm{d}t + f_2(t, Z_t)\mathrm{d}B_t \right)+ (g(t)X_t+h(t))f_2(t, Z_t)\mathrm{d}t = - Z_t\left((a(t)X_t+g(t)h(t))\mathrm{d}t+ g(t)X_t\mathrm{d}B_t\right)\end{align*}
and conclude that $f_2(t, Z_t) = -g(t)Z_t$. Now
\begin{align*}X_t\left(f_1(t, Z_t)\mathrm{d}t -g(t)Z_t\mathrm{d}B_t \right)- (g(t)X_t+h(t))g(t)Z_t\mathrm{d}t = - Z_t\left((a(t)X_t+g(t)h(t))\mathrm{d}t+ g(t)X_t\mathrm{d}B_t\right)\end{align*}
simplifies to
\begin{align*}X_tf_1(t, Z_t)\mathrm{d}t -g(t)^2Z_tX_t\mathrm{d}t = - a(t)Z_tX_t\mathrm{d}t\end{align*}
and so
\begin{align*}X_tf_1(t, Z_t)\mathrm{d}t = X_t\left( (g(t)^2- a(t))Z_t\right)\mathrm{d}t\end{align*}
let us conclude that
$$ f_1(Z_t, t) = (-a(t)+g(t)^2)Z_t.$$
Thus $$\mathrm{d}Z_t = (-a(t)+g^2(t))Z_t \mathrm{d}t - g(t)Z_t\mathrm{d}B_t,$$
you can see the explicit form of $Z_t$ in Case 1 and
$$\mathrm{d}(Z_tX_t) = (b(t)-h(t)g(t))Z_t\mathrm{d}t + h(t)Z_t\mathrm{d}B_t.$$
Using Ito's lemma we can show that $(Y_t):= (Z_t^{-1})$ is an Ito process such that it satisfies
$$ \mathrm{d}Y_t = a(t)Y_t \mathrm{d}t + g(t)Y_t\mathrm{d}B_t,\ \ Y_0 = 1$$
it has an explicit form
$$ Y_t = \exp\left(\int_0^t (a(s)-\frac{1}{2}g^2(s)) \mathrm{d}s +\int_0^t g(s)\mathrm{d}B_s\right).$$
Finally, we see that
\begin{align*}\mathrm{d}(Z_tX_t) =& (b(t)-h(t)g(t))Z_t\mathrm{d}t + h(t)Z_t\mathrm{d}B_t \end{align*}
yields
\begin{align*}Z_tX_t =& Z_0X_0 + \int_0^t (b(s)-h(s)g(s))Z_s\mathrm{d}s + \int_0^t h(s)Z_s\mathrm{d}B_s \end{align*}
Hence, we have the explicit solution
\begin{align*}X_t =& Z_0X_0Y_t + Y_t\left(\int_0^t (b(s)-h(s)g(s))Z_s\mathrm{d}s + \int_0^t h(s)Z_s\mathrm{d}B_s\right). \end{align*}
Best Answer
Your solution to the ODE is incorrect. Indeed, $$ \mathrm d\alpha_t = (a-b\alpha_t)\mathrm dt,\quad\alpha_0=1, $$ has solution $$ \alpha(t)={\mathrm e}^{-bt}+\frac ab\left(1-{\mathrm e}^{-bt}\right),\quad t\ge0. $$ Additionally you made a mistake when equating (I) and (II), namely you should get $$ aY_t\mathrm dt+\alpha_t\mathrm dY_t=a\mathrm dt+c\mathrm dB_t, $$ so this approach does not work. (Since this S.D.E. is no easier to solve than the initial one.)
You should rather find the solution to $$ \mathrm d\alpha_t = -b\alpha_t\mathrm dt,\quad\alpha_0=1, $$ and apply the variation of the constant method that you propose.
Once you have done this, in order to solve question $2$ start by finding the distribution of $X_t$ when $X_0\sim\mathcal N(m,\sigma^2)$ is independent of $X_t$. At this point, it should be clear what the required conditions are.