Use the select all icon (a dotted square) in a message list, then either the trash can icon or menu (delete now, or hide) once you've go them selected.
The "select all" by default means "only messages visible on the screen". If you really want to select "all" (loaded) messages: app settings -> message list -> scroll down -> "select all works on" -> choose "loaded messages".
Finally, to delete all messages from Deleted / Spam folders, you can long press them in the account list and choose Delete all from a popup menu. Note that this will delete from the server too.