Depends on the device / hardware.
AFAIK if you try to upload a compressed texture and ask for automatic mipmap generation on a mobile device you’ll either get an error, black mipmaps, or an uncompressed texture. Something like ASTC takes a beefy desktop PC several seconds to minutes(!) to compress, so there’s no way a mobile GPU can do it. I’ve heard some Mali devices will accept ETC1 textures, but that’s a fairly simply format so it’s plausible to do real time compression of those on a mobile device (but it’s still going to be pretty slow).
On Desktop, AMD & Nvidia will certainly accept DXT1/5 textures. For Direct3D the spec actually defines what formats can be used, and any compressed textures are supposed to fail silently(!?), though I suspect it’ll work there too for DXT1 & DXT5, at least for non-mobile Direct3D.
But yes, this is happening fully on the CPU, not the GPU. Is it going to be faster than what you can generate in Unity? Probably. But also probably not that much faster.
// load DXT1 texture w/o mip maps
Texture2D temp = new Texture2D(resX, resY, TextureFormat.DXT1, false);
temp.LoadRawTextureData(data);
// create new texture with same resolution
Texture2D tex = new Texture2D(resX, resY, TextureFormat.RGB24, true);
// copy raw pixel data into the first mip level
tex.SetPixels(temp.GetPixels(0), 0);
// generate mip maps
tex.Apply();
// compress into DXT1
tex.Compress();
// copy top mip level from original texture
Graphics.CopyTexture(temp, tex);
// unload temp texture
Destroy(temp);
However, if you’re generating compressed texture data already, why not generate the appropriate mip maps for it too at the same time? Most tools that generate compressed texture data are going to do that by default, and that’ll be way, way faster than either “automatic” mipmap generation option, and much higher quality.
TLDR; Desktop GPUs might support automatic mipmapping of compressed textures, but it’s technically outside of the API spec to do so. You should be supplying your own mipmaps instead.