Again, this is based on what I recall from work, and I have been out of the field for several years now, so take it for what it is worth.
When you say a D78 frame and a D77B frame, I am going to assume (I know, never assume
) you are referring to the coiled frame, and not just the frame the fields are placed in. I worked in the coil shop, the motor line was elsewhere, but from what we were told, a newer model EMD frame was an EMD frame, the armature coils and bearings made the difference between the D47 through D78 line. The major field coil changes occured in in the later D87 series.
Bear in mind, there were cast and fabricated frames, and an older style frame which I recall discussion of, something along the lines of wide and narrow window frames, but I cannot recall which is the newer style at this point. This had something to do with the end bells and bearing supports I believe.
The field coils from D47 to D78 are identical, so you should be able to put a D78 armature in a D77 coiled frame, provided you have the correct bearings, caps etc. Would it be a D78...I am not sure. That may require a check of EMD manuals to see if you have the correct parts. I am pretty sure there are a lot of mixed and matched motors in service, that is one good thing about EMD products, parts are interchangeable. If your D47 frame grounded the number 4 interpole coil, you can replace it with a D77 equivalent and it will work just as well as a new D47 IP. I recall there may have been a minor change in the air (cooling) baffles that go on the side of the coils at one point, but the new style is totally interchangeable with the old, so it would not make a difference.
Again, this is based only on my memories of what we produced in the coil shop, but after the mid 1980's we made only one style armature coil for pre-D87 motors, a D78 equivalent. There simply was no demand for the older D77 style any longer. The D78 was considered equivalent to and a direct replacement for a D77, and was an improvement in operation and performance, not so much a huge increase in power. All I know is we sold a lot of them.
I don't believe that there was a huge rating difference between a D77 and a D78, the D78 was an improvement in the armature windings that in the eyes of EMD warranted a new model number rather than another sub-model in the D77 line.
As far as mixing motors in a truck, that is out of my line. I do recall another thread on this elsewhere, and I believe this is also a common practice, provided the motors are of a similar series, such as your D47 in among a group of D77's. The difference in windings is not that huge that it should make a great difference, the D47 may run hotter and have a shorter life as a result, but I doubt it would derail the train. I think you might get into trouble mixing a D87B and a D27 in the same truck though!