Similarity of slow stripe fluctuations between Sr-doped cuprates and oxygen-doped nickelates