The AtoD Rechargeable Battery is a design concept that attempts to solve that problem by using a single rechargeable battery core that's surrounded by memory foam that conforms to whatever shape/size you need. Brilliant, right? Well, it might be easier to make a removable sleeve to shim up a smaller battery to fit a "D" slot than it would be to squish a D-sized piece of foam down to an AA-sized slot. Sometimes, it's hard enough to fit normal batteries in — these could be a nightmare to remove, especially once the memory foam begins to expand. Plus, the design doesn't take into account the different capacities that different sizes provide.
Still, it's an interesting idea. What's next: inflatable batteries?