Let us first show that if $f_n \to f$ everywhere, then $f$ is also measurable, if $Y$ is a metric space. The proof is more or less literally taken from Serge Lang's "Real and Functional Analysis". A different (shorter) proof is given in Dudley's book "Real Analysis and Probability", Theorem 4.2.2.
First, let $U \subset Y$ be open. For each $x \in f^{-1}(U)$, we have $f_n (x) \to f(x) \in U$ and thus $f_n (x) \in U$, i.e. $x \in f_n^{-1}(U)$ for all sufficiently large $n \geq n_x$. This proves
$$
f^{-1}(U) \subset \bigcap_{m=1}^\infty \bigcup_{k=m}^\infty f_k^{-1}(U). \qquad (\dagger)
$$
Now, let $A \subset Y$ be closed. If
$$
x \in \bigcap_{m=1}^\infty \bigcup_{k=m}^\infty f_k^{-1}(A),
$$
then for each $m$ arbitrarily large, there is some $k \geq m$ with $f_k (x) \in A$. This implies that there is some subsequence $(f_{k_\ell})$ with $f_{k_\ell} (x) \in A$ for all $\ell$. But $f_{k_\ell} (x) \to f(x)$. Since $A$ is closed, this yields $f(x) \in A$, i.e. $x \in f^{-1}(A)$. Hence,
$$
\bigcap_{m=1}^\infty \bigcup_{k=m}^\infty f_k^{-1}(A) \subset f^{-1}(A). \qquad (\ddagger)
$$
Now, let $U \subset Y$ be open and define
\begin{eqnarray*}
A_n &:=& \{y \in Y \mid {\rm dist}(y, U^c) \geq 1/n\},\\
U_n &:=& \{y \in Y \mid {\rm dist}(y, U^c) > 1/n\}.
\end{eqnarray*}
Since the ${\rm dist}$ function is continuous, we see that $U_n$ is open and $A_n$ is closed with $U_n \subset A_n \subset U$ and $\bigcup_n U_n = \bigcup_n A_n = U$. Here, the equality to $U$ uses the fact that $U$ is open.
Using $(\ddagger)$, we see
$$
f^{-1}(U) = \bigcup_n f^{-1}(U) \supset \bigcup_n \bigcap_{m=1}^\infty \bigcup_{k=m}^\infty f_k^{-1}(A_n) \supset \bigcup_n \bigcap_{m=1}^\infty \bigcup_{k=m}^\infty f_k^{-1}(U_n).
$$
Conversely, $(\dagger)$ implies
$$
f^{-1}(U) = \bigcup_n f^{-1}(U_n) \subset \bigcup_n \bigcap_m \bigcup_{k=m}^\infty f_k^{-1}(U_n).
$$
All in all, we get equality. Since the right-hand side is a measurable set, $f^{-1}(U)$ is measurable. This shows that $f$ is measurable.
Now, if $X$ is a complete measure space and if $f = g$ a.e. with $g$ measurable, then $f$ is also measurable. To see this, let $N \subset X$ be of measure zero with $f = g$ on $N^c$. Now, if $U \subset Y$ is open, then
$$
f^{-1}(U) = [g^{-1}(U) \cap N^c] \cup [f^{-1}(U) \cap N],
$$
where $[g^{-1}(U) \cap N^c]$ is measurable because $g$ is and $[f^{-1}(U) \cap N]$ is measurable as a subset of a null-set, because the measure space is assumed complete.
Thus, if the convergence is only true almost everywhere, i.e. on $N^c$, where $N \subset X$ is of measure zero, then $g_n := f_n \cdot \chi_{N^c}$ is measurable with $g_n \to f \cdot \chi_{N^c}$ pointwise. Hence, $f \cdot \chi_{N^c}$ is measurable. But $f = f \cdot \chi_{N^c}$ on $N^c$, i.e. almost everywhere. Hence, $f$ is measurable.
Finally, we show that the statement is false in general if $Y$ is not a metric space. This counterexample is taken from Dudley's book, Proposition 4.2.3.
We take $Y = I^I$, where $I =[0,1]$ is the unit interval. We equip $I$ with the usual product topology and we define
$$
f_n : I \to I^I, x\mapsto (y\mapsto \max \{0, 1- n|x-y|\}).
$$
Since $I$ is first countable, $f_n$ is continuous if we can show that $x_k \to x \in I$ implies $f_n(x_k) \to f_n(x)$. But this simply means $f_n(x_k)(y) \to f_n (x)(y)$ for all $y \in I$, which is easy to see.
Now define
$$
f : I \to I^I, x \mapsto (y \mapsto \chi_\Delta (x,y)),
$$
where $\Delta = \{(x,x) \in I\times I \mid x\in I\}$.
It is easy to see $f_n (x)(y) \to f(x)(y)$ for all $x,y\in I$. But this means $f_n(x) \to f(x)$ for all $x \in I$.
Now, let $E \subset I$ be an arbitrary subset (potentially nonmeasurable) and let
$$
W := \{g \in I^I \mid \exists y\in E : g(y) > 1/2 \} = \bigcup_{y \in E} {g \in I^I \mid g(y)>1/2}.
$$
Then $W \subset I^I$ is open, but $f^{-1}(W) = E$. If we take $E$ to be nonmeasurable (w.r.t. the Lebesgue $\sigma$-algebra), this shows that $f$ is not Lebesgue-measurable, although all $f_n$ are continuous and hence measurable.
The best I can think of, are:
Given a metric space $(X,d)$ , we can assign sigma-algebras.
1) Borel Measure:
This is the sigma algebra generated by the open sets generated by the open balls in the metric.
Or,
2)Looking at some of the linked questions are that of a Hausdorff measure
associated with a metric space:
https://en.wikipedia.org/wiki/Hausdorff_measure
But yours is an interesting question: given a measure triple (X, A, $\mu$), where $A$ is a sigma algebra and $X$ is the underlying space, can this be the Borel algebra resulting from a metric space? I don't have a full answer but some obvious requirements are that $X$ must be metric , or at least metrizable.
Still, while outside of the scope of your question, one can define measures on non-metric, non-metrizable spaces using the Borel sigma algebra.
Best Answer
If we have a metric space $(X,d)$ we can define a topology (the smallest one that makes all metric balls open). This topology generates a Borel $\sigma$-algebra (the smallest one that contains the topology). On the latter we can talk about measures. It's a solved problem in general topology to characterise those topological spaces that can be defined from a metric (the so-called metrisable topological spaces, look up the Bing-Nagata-Smirnov theorem, among others).
But the metric can also give rise to a metric outer measure directly and the resulting measure (via the standard Carathéodory construction) is at least defined on all Borel sets (as above). I think the Hausdorff measure for $s=1$ gives the Lebesgue measure on the reals, I think. I'm not sure whether the analogous problem of recognising such spaces among all measure spaces is open or not.
If we have a measure space $(X,\Sigma, \mu)$ with finite measure, we can define a metric on the set of equivalence classes of $\Sigma$ under the equivalence relation $\sim$ defined by $A \sim B$ iff $\mu(A \Delta B) = 0$, where the latter is the symmetric difference $A \Delta B = (A \setminus B) \cup (B \setminus A)$, by $d([A],[B]) = \mu(A \Delta B)$. A measure is called separable whenever this metric space (or rather, its topology) is separable.
This about exhausts what I know about metric/measure relations. Maybe it helps.