Can I get scabies from being dirty?

No. You can only get scabies from someone who has scabies (or their clothes or sheets).
No, you get scabies. From being in contact with scabies. Scabies is usually spread by close physical contact. It can also be spread by using the same bedding or clothing as someone who is infected with scabies.