The abelian sandpile model on randomly rooted graphs and self-similar groups