ECVs have to be single rider and can't tow anything. I'm honestly not sure whether I would risk putting the dog in the basket as a "passenger"? I've seen it before, but I've also seen (and done) plenty of lap riding, which is definitely against the rules. And that's assuming your dog will tolerate riding in the basket.
This sounds like a pretty miserable experience for the dog all around. I don't think I've ever seen an ECV with enough floorboard for this.
It's not like they are going to arrest you, they'll just tell you to have the dog walk. I would be very nervous with a little dog walking next to an ECV. Heck, it can be hazardous with an adult paying attention.