Yes. Although, there are many variables to performance.
There are file system specific limits on the number of files per file system. Usually a few hundred thousand is tiny in comparison, but know the limit.
One challenge is the enormous directories that contain hundreds of thousands of files. Not the total size of the files, but the directory entry itself. This can drastically slow down listing the directory.
Files can be spread across a directory structure, perhaps based on some kind of hash from them. So the file with SHA1 da39a3ee5e6b4b0d3255bfef95601890afd80709 goes in d/da/da3/ as deep as you want.
Or, send them off to object storage and let that system deal with files in its own way. This could be distributed storage you build or a cloud that does it for you.
In either case you likely can put it behind a content delivery network. CDNs have POPs closer to your users and can cache things.