I hate mayo - something about it immediately triggers my gag reflex. I usually find myself using milk-based substitutes to get the creaminess and richness. Cream cheese actually pairs really well with pesto ad tomato - I put pesto, cream cheese, and chopped tomato in a pan, cook over medium heat until the cream cheese melts into the pesto, stir it all up, and use it as a sauce on things like pasta or veggies (excellent over zucchini). so if there's a chance for it to melt, cream cheese could work in recipe #1. In recipe #2, what about something like sour cream? (I'm assuming it's being used as a binder?)

Then #1 doesn't need anything but the pesto. Even though I like mayo the thought of mixing it with pesto sounds disgusting, though yogurt would work if you really wanted a creamy pesto ... or use sour cream.

#2 could go either way with yogurt or mayo ... or even sour cream.

I agree with another poster who says there is no universal substitute. It depends on the dish.