Consider the design of a conventional axle. This is a cutaway of a rear hub, so just look at the right-side and imagine that reversed on the other end.
In the middle is an axle of threadded rod. A bicycle has maybe 15mm of this poking out on either side, and it is supported on the dropouts of the fork or frame.
If you replace this axle with a much longer one and only support it on one side, then you risk bending the axle just outside the locknut.
By comparison a wheelchair axle (aka a stub axle) has a short shaft but its much meatier. In this image, #38 seems to be a collar or similar to spread the load.
Also consider that bicycle wheels do not take drive through their axle. THe axle is fixed and the wheel rotates around that.
So your pedal car won't drive through the axle very well. Instead you want the bearings to be on the body of the pedal car, and the whole axle and wheel should be locked up, something like this:
So the rear wheels are direct drive.
Safety avoid the temptation to make a three-wheel pedal car. They are inherently tippy, and not recommended.
Steering A four wheel pedal car will probably need ackerman steering else its hard to turn. Depending on your kid's weight this may not be an issue.