Yes you can use dishwasher detergent to wash clothes in a washing machine if you've run out of laundry detergent.
I've done it before without any problems when I've run out of laundry detergent and didn't have anymore money to buy more laundry detergent.