As modified gravity theories, the 4-dimensional metric $f(R)$ theories are cast into connection dynamical formalism with real $su(2)$-connections as configuration variables. This formalism enables us to extend the non-perturbative loop quantization scheme of general relativity to any metric $f(R)$ theories. The quantum kinematical framework of $f(R)$ gravity is rigorously constructed, where the quantum dynamics can be launched. Both Hamiltonian constraint operator and master constraint operator for $f(R)$ theories are well defined. Our results show that the non-perturbative quantization procedure of loop quantum gravity are valid not only for general relativity but also for a rather general class of 4-dimensional metric theories of gravity.