Sometimes. You can swap preamp valves of the same type safely, and it can be fun to experiment with the different sounds. (NOTE: When I say “safely”, remember there is potentially still 300v in those socket holes. And 300v can kill you.)
Take extra care that you don’t bend a pin when you are aligning the valve or things may not go so well for you or the amp. If you don’t know which valves will give you the sound you want, it will be very “hit and miss” (aka expensive). As a musician and tech, I can help you tailor the sound you want.
With a solid state (transistor) amp, the chances of repairing it on your own are much lower. It is almost impossible to see a fault. Parts are generally soldered in. Please don’t touch a circuit with a soldering iron. There is a very good chance you will make things worse or it may even shock you (although probably not fatal in a solid state amp).
Warning 1. Never open a valve amp. The voltages inside will ensure that you are extremely dead. If you correctly thought 240v would kill you, I would not recommend touching a capacitor that is holding a surprise 400v even with the power cable pulled out. You will discover that Superman is not the only person who can fly.
Warning 2. Never change an external fuse with the power cable plugged in. See Warning 1 about the ensuing death. Some fuses are wired so that the amp will be dead but the fuse will be live.
Warning 3. Never change power valves on your own. In an emergency, this may be OK in the middle of a gig, but bring it to me straight after. Class AB amps (most of them) need to be biased, and valves need to be in matched pairs. Class A amps (eg Vox, Matchless, at al) may not need biasing, but valves still need to be matched carefully.