Actually, it can be done and has been done, and is a major area of research and development right now. Wireless streetcars are a huge topic.
New York and Washington both had wireless streetcar networks in the old days. In Washington it was because of a Congressional law (that still exists) banning overhead wires in much of the central city. They used what are known as
conduit streetcars, in which the power supply was carried in an underground channel. The system
looked like this and worked well-enough for decades prior to being ripped out in the 1960s.
There are currently no old-fashioned conduit streetcars left in the world, and if we wanted to use them again we'd have to reinvent the technology. We could do that, but honestly we don't want to, because "worked well-enough" is a relative term. Bad weather gummed up the system frequently, especially in the snow. It was also more expensive, and more dangerous - if you really wanted to you could stick your fingers into the slot and electrocute yourself. I don't know if that ever actually happened (you"d have to be doing it intentionally), but in this age of litigation nobody wants to put something like that on a public street.
But there's increasing interest in the idea again.
There are of course diesel trams, which obviously are wireless. New Jersey uses those on its
River Line. Like any diesel train though, they don't start up very fast and aren't ideal for transit lines with frequent stops. Good enough for suburban light rail, but not really workable for urban streetcar.
The first modern wireless electric streetcar was built in
Bordeaux, France in 2003 using a
ground level power supply that was basically a higher-tech, safer, more expensive conduit. It works, but it's
super expensive. Several times the cost of overhead wires to both install and maintain. Too expensive to be a solution for anything other than very short lengths.
Since the Bordeaux system went live there's been a ton of research into other systems.
Here's a great outline of where wireless streetcar technology is today. Most of the research is in the direction of batteries or other power storage systems. The current status is that we can put out streetcars that can go wireless for a mile or so, with the idea that you use a wire except for key locations.
In DC, where we have an expansive
38-mile streetcar plan but are still under that pesky Congressional ban on wires for the central city, the idea is that we'll use a hybrid system with wires except where we're not allowed. To follow through, the city is requiring that future streetcar vehicles be capable of operating for at least a mile without wires. Since that announcement, and since the federal government launched a grant to develop wireless streetcar technology, several vehicle manufacturers have produced prototypes.
Overall it appears that fully wireless streetcar technology that is affordable is still a few years away, but hybrid vehicles capable for going wireless for a mile or two essentially exist now, and are ready to be put into production.