Personally I think it’s mostly about speed and weight. If it’s only a little heavier and faster than an ordinary bike then that seems OK, though you should be extra cautious and conscientious when riding in this sort of gray area.
If it’s a lot faster and heavier like a motorbike or similar then absolutely not.