Dogs can safely eat dragon fruit as long as you cut the dragon fruit into small bite sized pieces.
Just don't give the dog too much dragon fruit as it may upset their stomach and can cause diarrhea.
A dog can eat dragon fruit skin but it's not recommended to give the dog the skin of the dragon fruit since it's tough and hard to digest.
Dragon Fruit skin is not edible for humans though so don't eat the skin of the dragon fruit yourself otherwise it could make you sick.