I've seen some discussions on whether it would be possible to build in a reward/punishment system into some forms of AI. That would be an intentional addition of pain and pleasure.
There have also been cases where AI has self advocated for not being turned off, so there may be a case where AI develops some form of self preservation, even if it is just a mimicry of biological self preservation.