In general, the answer is no. Madness is craziness caused by a medical condition whereas craziness is not. However there are also different meanings to the words and must be differentiated in the context. For example,
I am mad at you = I am angry at you. Here "crazy" cannot be substituted for "mad.
I am crazy for you = "I am so in love with you". Here "mad" cannot be substituted for "crazy".
In this case, either word can be used for cussing someone,
"You XXX dog!" where XXX can be "crazy" or "mad".
Another side interest, when you are poor, you care considered as crazy but when you are rich, you are considered as eccentric. Here both words mean the same. However, "crazy" has a negative connotation while "eccentric" has a positive connotation.