Yes. Just make it as you normally would and then put it into some kind of small-ish freezer containers (unless you eat a gallon of pesto at once). If you want and if you're using something other than bags to freeze it in, you can pour a little extra olive oil on top of the pesto to avoid the harmless but not so pretty browning of the top exposed to air.
Not really related but fun: we leave the seedheads on the plants in the fall so we can watch the goldfinches eat them, and this hasn't affected the quantity of leaves the plants put out contrary to conventional wisdom. OTOH, maybe our basil plants would grow to be 6 feet tall instead of 3 if we deadheaded them!