Does charging a phone with another phone's charger affect it in any way? I have a Samsung S4 and because its charger is short I charge it with a Samsung Wonder charger. I am afraid that it can damage the battery or something. Will it?
Generally speaking the wrong charger to the wrong phone can cause damage.

However in your case, I do not believe that there is much to worry about.  The article below is a gizmodo article that explains in pretty good detail.

http://gizmodo.com/can-i-use-the-same-charger-for-multiple-devices-510829339

Basically the whole using the "wrong charger" was an issue back before the micro-usb standard.  Now that there is an international standard for the micro-usb, the voltage is limited to 5V.  


  
    This used to be a much bigger issue on account of the wide variety of proprietary charging units and pin connectors that came with each device. Thankfully, the advent of USB changed all that and has provided an easy, standardized platform for charging devices. All USB cords carry the same 5V, regardless of if it's got a 30-pin head or a microUSB plug, whether it's first-party or third. That means DC chargers are now brand agnostic; if the volts, amps, and connectors are compatible, an Apple wall wart can charge an HTC just as easily as a Samsung. That if, though, is where people run into trouble.
  


In terms of the current, there can be issues that arise in the amounts of amperes that are flowing through  Take for instance the iPAD can charge off of 2.1 amp.  If the charge to it is only say 1 amp, then it won't charge as quickly.


  
    Because they have consistent, standardized voltage, USB chargers need another means of putting more power (in terms of watts) into larger gadgets faster. To do so, the system will increase the current (measured in amps). Most USB cables designed exclusively for charging (as opposed to data transfer) limit the current to between 1 and 1.5 amps, although new iPad chargers can deliver 2.1amps, and a standard USB port on your laptop only puts out .5 amps. This is why a 1 amp charger isn't effective on a 2.1 amp iPad. The device consumes power at the same rate that it's added.
  


Gizmodo also discusses things such as chips in the battery that monitors the charge (why you can plug your phone in at night and go to bed).


  
    Smart chargers are those that utilize a small CMOS chip to monitor and manage the state of charge (SoC) and state of health (SoH) of similarly-equipped batteries. This is a de facto feature on most every modern secondary battery on the market, and it's ubiquitous among Li-ion systems. This feature allows the batteries to be left unattended when charging without the fear of having them overheat and explode, and while maintaining 100-percent capacity over long periods via a trickle charge.
  


The author of the Gizmodo article, ANDREW TARANTOLA, does not think that you should use a different phone charger and that you should use the specific device's charger with the specific device. 


  
    Once you're sure that your device's needs line up with your charger's output, all that's left is ensuring your USB cords are equipped with the proper pin connector. The micro-USB to USB cord that came with your last phone works just as well with your new one and can plug into any suitable USB power brick, so why do you have multiples of it—each with its own brick?
    
    Instead, just stash a single spare brick in your bag, bring only the cords you need, and stagger your device charging so that one is always plugged into a port on your computer.
    
    Tl;dr? While you can use the same charger for multiple devices, you probably shouldn't. Not unless you want to ruin your gear, or wait a lifetime for it to recharge.
  


So if you do not want to take the risk or what not, then you can use the correct charger (specific charger for specific phone).

I'm currently using a motorola backflip usb cable with the iPhone wall charger to charge my Samsung Galaxy S4 Active.  I have not noticed any issues at all.