They both mean the same and so can be used interchangdably.
But to me, 同日 sounds a bit formal and 同じ日 is a bit casual.
So I would use 同日 like in a business situation and use 同じ日 when I talk to my friends or in an informal situation.
Hope this helps :)