Internally and externally driven flows of complex fluids: viscoelastic active matter, flows in porous media and contact line dynamics