Yes, a dirty razor can cause infection. This is because the razor's blades are not clean and can cause bacteria to enter your skin.