Can a girl get pregnant by washing herself with a soap that has perm on it for 7 hours?

Very low chance. Sperm outside the body for this time period, especially in the presence of a detergent, would most likely not be viable. While it is not impossible, the chance of pregnancy from the situation you describe is incredibly low.