Can you use brandy instead of rum in cake recipe
Almost certainly yes, but the flavors will be slightly different.

Brandy is likely to be slightly more acidic than rum, but otherwise quite similar in composition, and should perform in the same way.

If you want a more tailored answer, you should provide more information, such as the full recipe.

See also:  Are there any general principles of ingredient substitutions?