agree with #1. an Euphorbia, though I'm not sure of the sp, could be E horrida or hybrid. one clue (of some other) to easily distinguish Euphorbia from cacty is by removing one of those spine, or those tiny leaves, or by wound the stem just a litle, all euphorbia will bleed milky sap, while none of cactaceae will.
#2, Still possible for a dragon fruit I guess, is this grown from seeds?, I grow Selenicereus megalanthus and Hylocereus Sp from seeds, and at the young stage they could look like that. but if you grow from cuttings of mature plant it is different.