There's nothing stopping you from going fast on a folder, that's just down to gearing. However there is something stopping you from going fast safely (or at least stably) on a folder. And that's mechanical trail.
Mechanical trail is the degree to which the front wheel acts like a swivel caster, that is, the degree to which it resists being turned and only wants to point forward. Various factors influence mechanical trail, but for small wheeled bikes really only one of them is dominant: the wheel size. All other things equal, the smaller the wheel, the lower the mechanical trail.
There are reasons you'd want to have a low mechanical trail: notably if you're planning on loading the front wheel with heavy stuff (like a porteur bike or a bike with heavy front panniers on it). But without this, low mechanical trail just makes the steering feel unstable. Small-wheeled folders are notoriously difficult to ride no-handed, for this reason. There are claims that low mechanical trail can make a bike more "nimble" for serious racers, whatever that means. But for most people, I think it's safe to say that they're far harder to control at high speeds in anything but basically a straight line.
So while it's *possible* to ride over 40 miles an hour on a Brompton, it's rather difficult to do so stably (and safely I think) compared to doing so on a racing road bike.