Lavoro di mattina. Appare nella mattina. Bevo caffé alla mattina.
Can di/nella/alla be used interchangebly with mattina? Or are there some rules when to use each?
It may be trickier than that.
"nella mattina" is not so used but it's correct nonetheless, and in the phrase you used it means that the guy showed up sometime during the morning.
"alla mattina" is more used, especially if you are talking about a habit, meaning "ogni mattina", every morning.
"di mattina" is by far the most common and can be used flexibly. You could say "Appare di mattina", "Bevo caffé di mattina" without problems. I would suggest you stick with this one :)