Quantum field theories and critical phenomena on defects