basically if you were to start off...
BMX bikes are definetly no no's, will NEVER work (well yeah.....................but that's like extremely rare and crazy)
XC bikes are definetly possible as back in the day pre-2000 All Trials bikes were pretty much XC bikes, like Schwinns, Cannondale's, Giant's were used if you couldn't believe, and they were ripping up things quite well, and i used to start on my Kmart MTB bike so yeah, in the end the answer is 'yes' it's possible
Just sort of expect things to die....slowly in the process
Which leads to the newer kids in the block
XC bikes = Stock/26" (you can ride it with completely stock parts)
BMX Bikes = Modified/20" (Longer term from 'mod' as these bikes were HEAVILY modified into the Trials bikes today with almost every part being special)