Your question of in and from is related to the intent of the verb you are using. Both are grammatically correct, however one does not make sense.
One does not buy something directly from a geographic entity, one buys things
on the way to
a place. One
from a geographic location.
I buy them in town.
Means you acquired something while at a town
I buy them from town
does not make sense. In fact if you wrote
I bought it from town.
a native speaker would probably think you meant
I brought it from town.