You can generally save viable seeds from basil plants that have gone to seed if the variety of basil is open-pollinated. Many varieties sold as seedlings are hybrids, and the seeds won't grow true-to-type, but there are lots of great heirloom varieties too that usually breed true.