I have another basic question, this time about approximation of functions.
Given $(p)_{i\in \mathbb{N}}\in \mathcal{A}=\{$all the families of orthogonal polynomials $\}$ and $f\in L^2(\mathbb{R})$, then there exist a sequence of real values $c_i$ such that $$ f=\sum_{i=1}^\infty c_i p_i. $$
Or in other sense, every family of orthogonal polynomials is a basis of $L^2(\mathbb{R})$.
is it true ?
No. The orthogonal polynomials are orthogonal with respect to some measure (depending on which family of orthogonal polynomials), but not Lebesgue measure on $\mathbb R$. In fact, no nonzero polynomial is a member of $L^2(\mathbb R)$. Since they are not members, they can't be a basis.
For example, the Legendre polynomials $P_n(x)$ are orthogonal for Lebesgue measure on $[-1,1]$. If $f \in L^2([-1,1])$, there are coefficients $c_n$ such that $f = \sum_{n} c_n P_n$ as a member of $L^2([-1,1])$. It may be that $f(x)$ is defined on all of $\mathbb R$, but there is no reason to think that the series will converge outside $[-1,1]$, or (if it does happen to converge) that the sum will have anything to do with $f$.