The clue is in the title here. Both dildos and vibrators are penis-shaped, and both are used for external and internal stimulation, either during masturbation or to enhance your sex life with your partner.
The only difference: vibrators (unsurprisingly) vibrate. This makes them excellent stimulation toys, with different vibration speeds and patterns enabling you to discover what works best for you.