Translation:I want to eat some cake first.
No, numbers (both cardinal ones and ordinal ones) always stand before the noun.
The only case in which ordinal numbers stand after the noun concerns the names of rulers, monarchs, popes, etc., but the number is spelt in Roman numerals (rarely in Western ones).
So in this sentence prima can only be an adverb of time.
In your sentence you are using 'first' as an adjective (the first cake, not the second one). In italian it would be 'Io voglio mangiare un po' della prima torta'. But in the sentence "Io voglio mangiare un po' di torta prima.", 'prima' is an adverb: prima // dopo, poi = first // then