Yes, you can! Since royal icing is a (very concentrated) form of meringue, you can bake it. Baking it will dry it out even further. It might become too hard, especially if you're already using a very firm icing type. Also, keep in mind that baking can initiate Maillard reactions, causing your royal icing to turn brown. This is especially true for lightly colored royal icings. On the photo below you can find a comparison of royal icing applied after baking (left) and before baking (right). Notice the difference in color of both the icing and the cookie.