Dogs have a surprising ability to make humans understand what their barks and growls mean, a study has shown.