Both are correct. There is a large difference in usage.
A. "There is a wide variety of opinion(s) on that topic." Here, variety=spectrum. Opinions exist on a spectrum, and thousands and thousands of different opinions can occupy different points on the spectrum. (Both "opinion" and "opinions" are OK, but "opinion" is less common and a bit old-fashioned.)
B. "This store sells five varieties of cheese."= It sells exactly five types of cheese. Here, "variety" is just another word for "type".