There are a few things to consider when determining whether or not a 5.2 bolt up to a 4.7 transmission. The first is the type of transmission. There are two types of transmissions, automatic and manual. If the transmission is an automatic, then the answer is yes, a 5.2 will bolt up to a 4.7 transmission. However, if the transmission is a manual, then the answer is no, a 5.2 will not bolt up to a 4.7 transmission because the bell housing pattern is different between the two engines.
The second thing to consider is what year model the engine and transmission are from. The reason this matters is because in 1998, Dodge switched from using an older style engine block to what they called the Magnum engine block for their V8 engines (which included both the 5.2 and 4.7). This new engine block had a different bell housing pattern than the older style engine blocks, so if you have a 1998 or newer Magnum engine with a manual transmission, it will not bolt up to an older style engine with an automatic transmission (and vice versa).
So in summary, whether or not a 5..2 will bolt up to your 4..7 depends on what type of transmission it is and what year model your vehicles are from