I undestand that it is correct to write: "Я былa в Москве" but if a name ends with "ё" would it still be correct to end the sentence with an "e"?
"Я былa в Мальмe (Мальмё), Швеция"
There are many Russian words that are indeclinable. So it's simply: Я былa в Мальмё.
For foreign city names specifically, you can take some of the wisdom on this question on the declension of foreign person names.
There are fairly exact rules on the intonation and final ending combinations that make a word indeclinable, and some exceptions, and some disagreement in some edge cases if we actually look at the data descriptively. (They tend to be foreign words, abbreviations etc.) But for a language learner I think it does not make sense to focus more than minimal effort on learning the rules explicitly - just see the examples.