Yes, Dog can eat carrot cake but limited contety and you can not feed daily them.
Cake also contain sugar whic is not good for dog.
Whilst carrots themselves and even some of the spices in a Cake are quite good for them.
However the sugar, and in wheat allergic dogs the flour are not very good for them.