Dogs are capable of telling the difference between two foreign languages, the results of a new study has found.