You can, but I don't recommend it. Adding direct heat to basil pesto will ruin its fresh flavor. It will still be good, but not as good as fresh. But I can testify that cold leftover pasta with pesto is delicious!