Mayonnaise is often times used in baking with a variety of recipes, though it cannot be used in just any recipe so you will need to keep that in mind when trying to decide if you want to use it as a substitution for something else. You should also keep in mind that mayonnaise contains a lot of oils in it so you will want to use less of whatever you are substituting it for, such as eggs.
Sometimes the use of mayonnaise in a certain recipe can throw the taste off completely which is why you might want to avoid using it sometimes. Whether or not you should use mayonnaise while baking just depends on the ingredients which you will be mixing it with.