Could this also be translated "I have a friend in the town" (and not be marked wrong)?
It could be translated that way, although ar an mbaile is a better translation of “in the town”. (Prepositions don’t always exactly correspond between languages.) Don’t be concerned at all about whether it results in being marked wrong or not; the whole purpose of beta testing is to find such problems (and to correct them) before a general release, and the Duolingo Irish course is still in its beta testing period.
Yup. Though 'baile' has a rather broader meaning than just 'town'. The best equivalent I can think of in English is 'settlement'.
"I have a friend who is in their house".
"I live in this place, but I have a friend from my home town".
"I may not have a friend at work, but when I'm at home I do".
I understand that the given sentence couldn't translate to all of these, but in a colloquial sense, could these all be appropriately used and understood?
Without any contradictory context, the sa bhaile in this sentence would be understood as "at home" (the place where I live).
No, it shouldn't, because that's not what the phrase sa bhaile means, and if/when you encounter that phrase, you need to understand that the speaker/writer means "at home", not "in the town".
But "in town" and "in the town" do not mean the same thing, so one can be right without them both being right.