That story is a classic urban legend.
Both agencies used pencils, but they were problematic because the graphite could break off / float around / cause shorts.
The space pen was developed by Fisher independently of NASA. NASA bought 400 of them for $2.39 each. The Roscosmos later bought 100 for the same price.