That depends on how you define virginity. If you insert a vibrator
into your vagina, you may break your hymen (the membrane at the
entrance of the vagina). But many women break their hymens by using
tampons, riding a bike, or through other completely non-sexual activities. Most people define a
virgin as someone who has not had sexual intercourse with a person.
Insertion of a dildo, vibrator, or other object isn't generally called
sex, it's called masturbation. If someone who has masturbated isn't considered a virgin, there's not a man in the world who comes to the marriage bed a virgin. If your definition of virginity hinges
on cultural customs or religious beliefs, you will have to refer to a
higher authority for the answer.
If you are trying to preserve your virginity because you are waiting
until marriage or for some other reason, and using a vibrator doesn't
violate the definition of virginity as defined in your belief system,
then using a vibrator for masturbating can be a great way to gratify
your natural sexual needs in a safe and healthy manner. Self-pleasure
is the safest sex there is!