The Riemann-Roch theorem for a holomorphic line bundle $L$ over a Riemann surface $X$ states that $$h^{0}(X,L)-h^{0}(X,L^{-1}\otimes K)=\deg(L)+1-g.$$ For $L=K^2$, the bundle of holomorphic quadratic differentials, we get $$h^0(X, K^2)=h^{0}(X,K^{-1})+\deg(K^2)+1-g=h^{0}(X,K^{-1})+3g-3$$ as $\deg(K^2)=2\deg(K)=4g-4$.
On the other hand, it is well-known that the space of holomorphic quadratic differentials can be considered as the co-tangent space to the Teichmuller space, and, thus, it has complex dimension $3g-3$. It means then that $h^{0}(X,K^{-1})=0$. But isn't $K^{-1}$ the holomorphic tangent bundle, so $h^{0}(X,K^{-1})$ is the dimension of the space of holomorphic vector fields? That would mean that there are no holomorphic vector fields, which is a nonsense. May I ask what do I understand wrong here?
Which Teichmüller spaces are you considering? For a curve $X$ of genus $g$, the degree of $\omega_X$ is $2g-2$ and the degree of $\omega_X^*$ is $2-2g$ (i.e. the topological Euler characteristic). This is negative for $g \ge 2$. In particular, the holomorphic tangent bundle of $X$ has no global sections for $g(X) \ge 2$.
In case of $g = 1$, your Riemann surface is a torus and has $h^0(X,\mathcal{T}_X) = 1$. The moduli of genus $1$ curves is $1$-dimensional so this agrees with prediction. Finally, for $X = \Bbb{P}^1$, $\omega_X^2 = \mathcal{O}(-4)$ and we have $h^0(\Bbb{P}^1,\mathcal{O}(-4)) = 0$ which agrees with the fact that there is a unique Riemann surface of genus $0$.