Can I use a vent that was over an electric oven for a dryer instead?
In general, it is a good solution.

There are a couple of potential issues:

Most dryer vent hose is 4" diameter, some oven vent is 6", so you might need an adapter

The other aspect that may need to be addressed is the louvers on the outside.  Be sure you dryer exhaust is strong enough to open the louvers or you may have to replace it for one with lighter duty springs.