They have different meanings, so you can't directly replace one with the other.
'make a difference' generally means to have an effect or make a change. The phrase is especially used to say that this 'effect' is enough to make a difference between a negative outcome and a positive outcome. For example, if a great soccer player joined a club that had been losing, I could say: "The new player made a difference to the club". He makes enough change/difference to the club that it now wins, rather than loses as it did before.
Something that 'matters' is simply something is important. For example, "It matters to me you study hard". I am saying it is important to me that you study hard.
If I said instead , "It will make a difference if you study", I am not specifically saying it is important, rather I am saying it will make a difference or change and you will likely go from a negative outcome to a positive outcome.