Yes, you can. It is safe to do so.
Caveats: 5w (iphone) charger will charge the ipad slower than the normal 12w charger. Other than that the 5w/12w charger will work with any product with lightning.
The same applies to the 30-pin charger for older devices.