They could technically be substituted for each other depending on the application, however they are quite different from each other and that is why we use both here. Mascarpone is much smoother and has a different type of flavor than ricotta. They combination of flavors is preferred in this recipe, but they can be substituted for each other if one isn't available at your grocery store.