If I had to guess I'm guessing those living in the "Wild West" that knew how to play instruments most likely came from urban areas and probably already knew how to play them and just used a local saloon piano or something like that?
It does fascinate me though that black musicians were especially noted for their use of guitar and piano when those two instruments are pretty expensive today. I know make shift guitars were a thing too, but I guess I'm curious if poor black musicians in a place like Louisiana or Tennessee used modern style guitars and how they might've acquired them.
You might like two other related answers to cobble together your own personal answer...
/u/hillsonghoods and /u/dgbd on How did an instrument as expensive and complicated as the violin/fiddle become associated with "poor people" music like Irish folk or Bluegrass?
/u/erus on What model of piano would be found in an 1860's Old West saloon?