Yes, a synthesizer is an electronic instrument capable of producing a wide range of sounds by generating and combining signals of different frequencies, timbres, and envelopes. These signals can be manipulated to mimic various musical sounds, including those of other instruments like the piano, violin, flute, and even non-traditional sounds. The versatility of synthesizers is due to their ability to control parameters such as oscillator frequency, amplification, filtering, and modulation.
Although it is possible to closely replicate the sounds of other instruments, there will always be some perceptible differences in timbre due to the unique physical characteristics of each instrument. Synthesizers are more often used to create new and original sounds, rather than just mimic existing ones. Nonetheless, high-quality synthesizers and skilled sound designers can make convincing imitations of various musical sounds.