An authorized dealer should be ethical enough to tell you.
If you bought something that seemed 'used' or was a demo, and the dealer did not tell you... well, they might try it.
"B" stock is actually marked on the boxes from the manufacturer as such (at least the major Japanese manufacturers.)
The manufacturer can tell you if it is "B" stock. The cannot tell you if it was a demo, or a customer return.
Demo stuff or an item someone demo'ed and returned is a bit of a gray area... I would want to know, but I think the dealer can sell it as new. (though the dealer SHOULD tell you...) It certainly has the new warranty.