Can I do the factory reset after upgrade to Android P?

Can I do the factory reset after upgrade to Android P? and Is it ok if I install by wipe all data and cache before I instal the zip file?