In most recipes you will be able to use pecans in place of walnuts, though some people find that the taste of pecans is far different from that of walnuts. Whether or not you enjoy the altered dish will depend on your own personal preferences. Walnuts and pecans are both types of nuts, so there is no reason why you cannot trade one for the other in a recipe.
Even though the taste of these two nuts may be significantly different, you should still be able to use pecans instead of walnuts no matter what the recipe/dish is. Just make sure that you use an equal amount of pecans for however many walnuts are called for in the recipe so it will be just the right amount.