Talk about clash of the worlds!
The Star Trek universe to my knowledge only extends up to the 29th centuary (or the 2.9th millenia), has had something similar to the STC disaster and features a 'golden age' of exploration and colonization.
The Warhammer 40k universe is some 37 thousand years into the future, compared to ST, and most of their history is wiped out.
Is there anything (besides decency, and respect for canon) stopping one becoming the other? I'm looking for a specific example that precludes this possibility, such as "The years covering Star Trek are covered in resources X and nothing matching that tech fits from the Warhammer universe" or "The Star Trek universe in the year 40K is know to be Y".