"If it was", where "was" is an ordinary past simple, can occur in an if-statement about the past:
1. If it was raining when you left home, why didn't you wear a coat?
"If it were", where "were" is a past subjunctive, can occur in an if-statement that presents a hypothesis:
2. If it were my car, I wouldn't park it in the street.
Often, especially in conversation, speakers will use "if it was" instead of "if it were", in sentences like #2:
3. If it was my car, I would have it painted green.
Some text books and style guides suggest that this usage is incorrect; but many well-known authors have used it (e.g. the philosophers George Berkeley in the 18th century, and A. J. Ayer in the 20th century).