If the laptops are identical, then it's probably safe. If the laptops are not identical, it won't work at best, and the battery could explode at worst. Laptop batteries need to be powered and charged at specific power levels, and it's dangerous to play with that.
Sheep Rustlers in the sky! <S> Slapt | <S> FUI | Air Warrior II/III
You'd need to make sure the adapter provides the same volts & amps to the laptop, and you'd best check the polarity as well.
To be more specific, the power supply must be the same voltage and polarity (and obviously the same physically). It also must be able to provide as much or more than the laptop requires. You can use a 105W power adapter on a laptop that only needs 65W, if the voltage is correct.