We investigate the strain-dependent electronic and magnetic properties of two-dimensional (2D) monolayer and bilayer MoS2, as well as 1D MoS2 nanoribbons and nanotubes using first-principles calculations. For 2D monolayer MoS2 subjected to isotropic or uniaxial tensile strain, the direct band gap of MoS2 changes to an indirect gap that decreases monotonically with increasing strain; while under the compressive strain, the original direct band gap is enlarged first, followed by gap reduction when the strain is beyond −2%. The effect of isotropic strain is even stronger than that of uniaxial strain. For bilayer MoS2 subjected to isotropic tensile strain, its indirect gap reduces monotonically to zero at strain about 6%; while under the isotropic compressive strain, its indirect gap increases first and then reduces and turns into direct gap when the strain is beyond −4%. For strained 1D metallic zigzag MoS2 nanoribbons, the net magnetic moment increases slightly with axial strain from about −5% to 5%, but drops to zero when the compressive strain is beyond −5% or increases with a power law beyond 5%. For 1D armchair MoS2 nanotubes, tensile or compressive axial strain reduces or enlarges the band gap linearly, and the gap can be fully closed for nanotubes with relatively small diameter or under large tensile strain. For zigzag MoS2 nanotubes, the strain effect becomes nonlinear and the tensile strain can reduce the band gap, whereas compressive strain can initially enlarge the band gap and then decrease it. The strain induced change in projected orbitals energy of Mo and the coupling between the Mo atom d orbital and the S atom p orbital are analyzed to explain the strong strain effect on the band gap and magnetic properties.