I'll assume that $X$ and $Y$ are open subvarieties of $M$, so that this looks like a Mayer-Vietoris sequence; I think this is the only sensible interpretation of the question. Since $X$ and $Y$ are not going to be projective I also interepret $\newcommand{\Hdg}{\operatorname{Hdg}}\Hdg(-)$ in the sense of mixed Hodge theory, that is, $\Hdg^k(X)$ denotes the Hodge classes in $\mathrm{gr}^W_k H^k(X)$$\mathrm{gr}^W_{2k} H^{2k}(X)$. Once we're working in mixed Hodge theory there's no longer any reason to assume $M$ smooth and projective either, so let's just consider an arbitrary algebraic variety covered by two Zariski opens.
Then there is the usual Mayer-Vietoris sequence $$ \ldots \to H^n(M) \to H^n(X) \oplus H^n(Y) \to H^n(X \cap Y) \to H^{n+1}(M) \to \ldots$$ where the morphisms are maps of mixed Hodge structures and in particular restrict to $$ \Hdg^n(M) \to \Hdg^n(X) \oplus \Hdg^n(Y) \to \Hdg^n(X \cap Y). $$$$ \Hdg^k(M) \to \Hdg^k(X) \oplus \Hdg^k(Y) \to \Hdg^k(X \cap Y). $$ However contrary to your guess it will usually not be exact on the left. For instance, take $M = \mathbf P^1$, and $X, Y$ the standard covering by two copies of $\mathbf A^1$, and $n=2$$k=1$. On the other hand, if $M$ is smooth then it is exact on the right (i.e. $\Hdg^n(X) \oplus \Hdg^n(Y) \to \Hdg^n(X \cap Y)$$\Hdg^k(X) \oplus \Hdg^k(Y) \to \Hdg^k(X \cap Y)$ is onto) simply because $H^{n+1}(M)$$H^{2k+1}(M)$ has weights $\geq n+1$$\geq 2k+1$. More generally, if $U \subset V$ is an open immersion of smooth varieties then $W_kH^k(V) \to W_kH^k(U)$$W_nH^n(V) \to W_nH^n(U)$ is onto.