I was learning about color wheel schemes but it is still unclear if I should use complementary or analogue scheme for successive sections on the website.
This is a very broad question. A quick answer is that most sites - if they do change colors - don't select colors based upon color theory. Sometimes there's marketing reasons; sometimes it's simply that which the designers and business agree "look good".
Although I noticed that many pages uses only white and gray background for different successive pages, why?
Usually content is king. And if content is not king then it's the overall look and feel of the design. Black text on a white background has been the preferred way to display a page for 20+ years even though studies have shown that a gray background, with less contrast, allows for a better reading experience.