In this edit I have modified my previous argument, and added the appropriate conditions to Harrington's theorem.
I will explain below why it is possible to arrange a model $M$ of $ZFC$ that:
(a) contains two nonisomorphic countable structures $\cal{A}$ and $\cal{B}$ (in a finite vocabulary) that share the same second order theory, and
(b) $M$ has a generic extension in which $\cal{A}$ and $\cal{B}$ differ in their seond order theory.
(1) By a theorem of Marek, if there is a second-order definable well-ordering of the continuum, then as soon as two countable structures are elementarily equivalent in second order logic, then they are isomorphic.
(2) On the other hand, by a result of Ajtai, if $G$ is Cohen generic over a model $M$ of $ZFC$, then in $M[G]$ there will be two countable models $\cal{A}$ and $\cal{B}$ in a finite vocabulary that share the same second order theory (indeed they form a pair of indiscernibles in $M$ and share the same theory in many other logics beyond second order logic).
$\cal{A}$ is the structure $(F^{G} \cup \omega, <_{\omega}, P_{G})$, where $F^{G}$ is the collection of all subsets of $\omega$ that differ in finitely many places with $G$, and $P_{G}$ is the relation that specifies which natural numbers belong to which subsets in $F^{G}$. $\cal{B}$ is defined similarly, with $\omega \setminus G$ swapped for $G$.
Since $\omega$ is rigid, $\cal{A}$ and $\cal{B}$ are nonisomorphic, and moreover, remain nonisomorphic in any generic extension.
(For proofs and references for (1) and (2) above, see Theorems 2.3 and 2.13 of this manuscript (Wayback Machine) by Lauri Keskinen, which I believe is his Ph.D. dissertation at ILLC Amsterdam).
(3) By a theorem of Harrington, if $M$ is a countable model of $ZFC$ in which (a) $2^{\aleph_0}$ is a regular cardinal, (b) $2^{\aleph_0} > \aleph_1$, and (c) $\aleph_1 = \aleph_1^{\bf{L}}$, then $M$ has a generic extension $M[G]$ in which there is a second order definable well-ordering of the continuum ((more precisely, a $\Delta^1_3$ one).
(See Theorem 2.1 of Harrington's Long projective well-orderings, Annals of Math. Logic, 1977; the specific conditions on $M$ are stated on p.8, at the beginning of the proof of Theorem 2.1).
Based on (2), we can arrange a model $M$ of $ZFC$ in which there are two nonisomorphic countable structures $\cal{A}$ and $\cal{B}$ as described in (2) that share the same second order theory, such that $M$ satisfies conditions (a), (b), and (c) of Harrington's theorem (say by adding $\aleph_2$ cohen reals to a model of $ZF + V=L$). Then by using (3) and invoking (1) we obtain a model of $ZFC$ in which two nonisomorphic structures that used to have the same second order theory now have different second order theories, since they remain nonisomorphic, as explained at the end of (2).
In light of Joel Hamkins' answer I should point out that Section 4 of Keskinen's aforementioned manuscript also addresses the effect of large cardinals on the issues discussed here.
You may also find my answer to this question to be of interest.