I had a friend who said there is a slight difference in the two phrases. But I don't see any difference between the two expressions. Could anyone explain it?
最后吃的菜 = 最后吃的(that you eat last) + 菜(dish/food);
so, 最后吃的菜 = "the dish that you eat last"
"最后吃的菜" is a noun phrase and it is "菜" essentially.
吃最后的菜 = 吃(eat) + 最后的菜(the last dish / the leftovers)；
so, 吃最后的菜 = “eat the last dish / leftovers”
"吃最后的菜" can be regared as an imperative sentence and it means "eat something". If you put a subject at the beginning of it（"我吃了最后的菜"/“我要吃最后的菜”，etc.）, it would be easier to understand.