Yes you can. The electrical system on the bike is water-resistant and is designed to tolerate rain. That said, manufacturers generally recommend not to leave the bike unnecessarily exposed to prolonged downpours, so as to avoid condensation in the display and other electrical components. Park under a roof where possible.
Speaking of water, when washing your bike most manufacturers recommend that you remove the battery and avoid using high-pressure water spray.