You can use the 2N3904 for pretty much any small signal NPN position. That doesn't mean that you are going to like how it sounds there though, but then again, maybe you will. Go look at any thread on transistors for Big Muffs and you'll get the idea. Some circuits sound better with certain transistors and some sound better with others. Much of it is up to your ears and you just have to try them out. Typical NPN BJT's are 2N3904, 2N5088, BC549C, BC550C, BC107, BC108, BC109, and 2N2222 (although the 2N2222 is a bit different). The 2N3904 tends to get used in utility settings, switching, LFO buffers, etc.
OP Amps are even more varied than transistors. So many different uses and types, Audio, single supply, rail-to-rail, FET input, BJT input, etc. Sometimes you can sub in pretty much anything, and sometimes the circuit depends on some specific characteristics of a family of op amps.