Yes, you can swap out pinto beans for other varieties like black beans, kidney beans, or navy beans.  Each type will bring a slightly different flavor and texture, but they’ll still work well in the recipe.  Just keep in mind that some beans, like black beans, may give the dish a darker color and a slightly earthier taste.