Never heard of tomato pesto, but you can certainly make normal tomato sauce with basil in it and waterbath-can it, and it's good See the Ball Blue Book or whatever other canning book you use for tomato sauce recipes.
Or for pesto, grind up your pesto and garlic and olive oil, then freeze (I like ziploc baggies b/c you can break off however much you want of the flat 'sheet' of frozen puree, and use as seasoning as well as future pesto). When you defrost it you can add the cheese and pine nuts, and there ya go, pesto. DO NOT try to can pesto, especially not in a waterbath canner.