Completely. You can replace it mostly, but not totally. If you replace it totally it gives your baked items a bit of a rubbery texture.
What I like to do in cakes and muffins is replace about 2/3 with pumpkin purée or whatever veggie/fruit you have.
This is my families fave right now
https://www.allrecipes.com/recipe/15760/carrot-cake/ . I replace 2/3 of the oil with pumpkin purée made from my garden pumpkins. I also cut the sugar a little.
I don’t think I would cut out butter in a cookie recipe unless you were going for a cake texture. I don’t know much, but I think cookies need that creaming of sugar and butter for the texture.