The dish can be saved.
Explanation
Regarding the rice itself seemingly it was cooked in a fleishig pot yet if the pot was not ben yomo (used with meat in the last 24 hrs) then halachically the rice does not become fleshing and bideved one can eat it with dairy , and even if the pot was used with meat in the last 24hrs yet if it the pan was clean then the halocho of the rice is that it is a Machloke between the Mechaber and Rama if it can be eaten with dairy we follow the Rama who is Machmir yet after the fact the Rama rules that it is allowed (some achronim are machmir).
[1]
If the margarine first mixed into the rice and from there it moved to the walls of the pot then a additional point to consider the maybe there was in the rice sixty times the margarine and then the rice or the pot did not absorb enough margarine to prohibit it.
[2]
Can one kosher enamelware?
regarding enamelware the halcho is that one cannot kosher it. as it has a porcelain coating and porcelain has the din of “cheres” which generally cannot be koshered.(explanation: we are uncertain how much of the non-kosher food which was swallowed by the walls of the vessel will be taken out by the koshering process and therefore the general rule is that such vessels cannot be koshered) therefore if the question would have been regarding metal or other types of dishes one could have koshered them yet in this situation that is not an option.
Yet,
For the dish to become not- kosher it needs to absorb the dairy margarine in its walls, in order for that to happen the margarine need to be hot over the temperature of 45 Celsius(yad soleds bo) if it is less than that temperature at contact it doesn’t have the ability to enter the walls of the dish, according to the question the rice was warm that means it was probably 30 something degrees Celsius according to this the margarine did not reach the heat with which it can get halachically absorbed into the dish.
In a situation where the margarine was hotter than 45 degrees Celsius there is another important halcha to take into consideration , the food was in a second vessel (kli sheni) being that the food cooked in a pan and then it was transferred to a second vessel , according to halocho there is much discussion if food which is in a kli sheni has the ability to prohibit food (although the food is over 45 Celsius),
the halocho is that bideved
after the fact the food is it is kosher, and one merely needs to wash the food and the pot.
[3]
Yet nonetheless there is discussion regarding a davar gush a hard piece of food that retains its halachic status of a first vessel (kli rishon) in a place of
great loss one can follow the opinions that davar gush has the halchic status of second vessel, in addition some hold that in any case rice does not have the status if davar gush so with this in mind bideved (especially if it’s a great loss) one can rely the opinions that the vessel remains kosher.
[4]
[1 שולחן ערוך יורה דעה סי’ צ”ה ס”א וס”ב. אבל ראה ש”ך סעיף קד שם בשם מהרש”ל שאוסר בדיעבד.
[2] ראה יו”ד סי’ צ”ד ס”ו.
[3]ראה שולחן ערוך יורה דעה סי’ ק”ה ס”ב, כף החיים סי’ ק”ה סקל”ח.
[4] ראה דרכי משה יורה דעה סי’ ק”ה סעיף קד וש”ך סי ק”ה סק”ח.