The correct form is always "It doesn't matter".
You will hear "It don't matter" in lyrics or movies. This is an informal way of saying the phrase. Either they were taught wrong from the beginning or they want to say this to be cool. ^^
In school and in everyday life "it doesn't matter" is what you should always use.
Ex:
It(singular) doesn't (singular) matter.
They (plural) don't (plural) matter.
Hope this helps.