Average velocity = net displacement / total duration of time
average speed = total distance traveled / total duration of time.
duration of time is a positive scalar quantity. If the magnitudes of average speed and velocity are equal, then,
net displacement = total distance traveled
This is only possible, if the body travels in a straight line in one direction.