In Spain, vehicle dealers have some kind of "fleet insurance" that covers the damage done by them or prospective buyers driving a non-registered vehicle. They just put a temporary plate inside the car, over the windshield, that identifies the car as "test-vehicle".
No bike dealer will offer a test drive on motorcycles. If you want to test one, ask a friend or use the brand "open days" in which they offer free test drives. Exception made some small ones, like Triumph, that handed me the keys of a Bonneville before I even asked for the price...
It the bike is not registered, you can't ride it. As I say, some dealers will let you test their bikes if the bikes are registered and you seem genuinely interested and cold-headed enough. But what would happen if you cause an accident, both to you, the bike and the damage done, is a mistery to me. If the bike insurance is issued "per person" it only covers the designated driver. It may cover all the damage done by the vehicle regardless of who the driver is, but it may not cover the self-damage, so the dealer could opt for bearing the cost or try to make you pay for it.
I have tried several bikes on "open days" and it seems to me the best way to test one. Full insurance, wide portfolio of bikes, and no pressure or obligation on you to buy.