Yes you can. Some washing machines even come with a separate bleach dispenser.
Therefore, it is nothing harmful if you use bleach in your washing machine.