The sentence is not correct.
As you believe, the correct sentence is: "The class can be anywhere between eight and thirty (students?).
The other speaker was probably confusing the sentence with "from....to." Another correct sentence with the same meaning would be:
The class can be anywhere from eight to thirty.
P.S. You might notice that I've written out the words eight and thirty. That is because there is a practice to spell out certain numbers, instead of using numerals. The Chicago Manual of Style* says:
Chicago's general rule. In nontechnical contexts, the following are spelled out: whole numbers from one through one hundred, round numbers, and any number beginning a sentence.
*The Chicago Manual of Style. 15th edition. The University of Chicago Press. 2003