How to collect reference values from hashmap?
unsafe {
        key.as_bytes_mut().sort();
    }

This works as long as you are working in Ascii, but will have undefined behavior if there is any unicode in the string.
 (*map.entry(key).or_insert(vec![])).push(s);

You don't need the dereference *, calling a method will automatically take care of that.
Its a bit tricky to help with your main question since I don't know what exactly you tried and why that didn't work.
A pretty direct translation of what you wrote into iterator syntax works:
map.values()
    .map(|v| v.iter().cloned().cloned().collect::&lt;Vec&lt;String&gt;&gt;())
    .collect()

I would however suggest doing something more like your second code block, and avoid cloning the strings:
    map.values().cloned().collect::&lt;Vec&lt;Vec&lt;String&gt;&gt;&gt;()

I'd do this:
 map.into_iter()
    .map(|(_key, values)| values)
    .collect()

By consuming the iterator we avoid cloning the vectors.
Alternatively, take the strings as input by reference and return them by reference:
pub fn group_anagrams(strs: &amp;[String]) -&gt; Vec&lt;Vec&lt;&amp;String&gt;&gt; {
    let mut map: HashMap&lt;String, Vec&lt;&amp;String&gt;&gt; = HashMap::new();
    for s in strs {
        let mut key = s.clone();
        unsafe {
            key.as_bytes_mut().sort();
        }
        (*map.entry(key).or_insert(vec![])).push(s);
    }

    map.into_iter()
        .map(|(_key, values)| values)
        .collect()
}