Chris B. answered 06/10/19
Highly Motivated Music Teacher Specializing in Percussion and Voice
Great Question! Trying to compare time signatures with different beat units (i.e. the bottom number) won't ever give a "mathematical" equivalence between the two, since what you're basically doing is comparing two different math base systems. The closest mathematical analogue would be comparing Base 10, which is the most heavily used system in the western world, to Base 8 or Base 12. Numberphile on YouTube has a great video explaining Base 12 which I highly recommend you check out.
The best way to answer the musical portion if the question is: comparing macrobeats (the big beat a conductor would conduct) and microbeats (the small beats you would count or subdivide) is where you'll find the correspondence. In both time signatures, the conductor will (usually) conduct four large beats, while the musicians may subdivide or play the smaller beats in between, either in groups of two in 4/4 or groups of 3 in 12/8.
Side Note: The reason a composer may choose to write in 4/4 versus 12/8 typically comes down to how they want the microbeats to feel and how easy the music would be to read. If they have a lot of triplets or want a bouncy or swing feel, they may choose to write in 6/8 or 12/8, such as with Percy Grainger's Children's March. If it's a very straight, evenly-divided piece with many groups of four sixteenth notes, they may choose to write in 2/4, 4/4, or 2/2, such as with John Philip Sousa's The Stars and Stripes Forever.
Hope that answers your question!