The word 'decent' is subjective.
Depending on whichever school you go to, 'decent' could mean a lot of things. In my old school 85+ is considered 'decent', whereas something below 95 in more academic circles may be considered a fail by some. Heck I even know some kids that consider anything below 99 to be a fail.
But to answer the OP's question: if 'decent' is 80-99 then, no you definitely don't have to go to a good school. However it helps. Not sure about anyone else but for me, working in an environment where the majority of my cohort is also striving for the best academically is incredibly motivation as it challenges me to perform at my utmost best.
Now onto the more statistical factor, a better school I would assume you mean a better cohort. A better cohort certainly boosts your SACs scores higher because SACs are just rankings and if your cohort does well in the exam, then your SAC marks will also go up. With this said, you can drop more marks in a school with a better cohort than one with a weaker cohort. Like at MHS, you would extremely appreciate getting an A+ and know you will still have the chance to get a really high study score but in a weaker cohort, an A+ could mean the difference between getting above or below 40 because you might not have the highest A+ in your year level. If you think about it, the school gives out a lot of A+ and in a weaker cohort, unless you all get A+ in the exam, these A+ from SACs may scale down to an A or B+ if you are not ranked high enough.