The answer is **no** in general, as the following example shows.

There exist complex surfaces $S$ with ample canonical class, $$p_g(S):=h^0(S, \, K_S)=2, \quad q(S):=h^1(S, \, K_S)=0$$ and $|K_S|$ *composed with a pencil*. This means that $$|K_S|=M + |F|,$$
where $M$ is a fixed curve and $F$ is a divisor with $h^0(S, \, F)=2$.
It is no difficult to construct examples where $M$ and the general curve in $|F|$ are smooth and intersect transversally. For a general discussion on such surfaces, see **[1]**.

Since $K_S$ is ample, we have $(M+F)^2 >0$. Moreover, by a result of Bombieri (see **[2]**) the canonical divisor is numerically $2$-connected, hence $MF \geq 2$. Finally, since $q(S)=0$, by the exponential sequence the group $\textrm{Pic}(S)=H^1(S, \, \mathcal{O}_S^*)$ injects into $H^2(S, \, \mathbb{Z})$, hence homologically equivalent divisors are linearly equivalent.

Being $K_S$ ample, $S$ is a projective variety. It follows by Chow Lemma that any closed analytic subvariety of $S$ is algebraic, i.e. all compact holomorphic curves in $S$ are actually effective divisors.

Now, $S$ contains no smooth divisor linearly equivalent to $K_S$, since all divisors in the complete linear system $|K_S|$ are of the form $M+F$. In other words, the curves in the homology class of $K_S$ cannot be smoothed holomorphically in $S$.

**References.**

**[1]** R. Pignatelli: *On surfaces with a canonical pencil*, Matematische Zeitschrift **270**, 1 (2012), 403-422.

**[2]** E. Bombieri: *Canonical models of surfaces of general type*, Publications Mathématiques de l'Institut des Hautes Études Scientifiques
**42**, Issue 1, pp 171-219 (1973).