If you re space the hub out to properly fit your frame yes. My winter beater wheels are a pair of ancient Shimano BMX hubs. I know I know! its a sin, but hell they work and theyre as old as me!
A track cog will thread on no problem to a bmx hub, if you plan on riding in the city alot, or like me, dont bother useing the brake long enough that it seized throw a little blue loc-tite on the threads. If that still makes you nervous BMX hubs have almost double the amount of threads a standard hub does. You can add a BB loc-ring to help snug it all up.