I recently contacted the Brazilian Consulate in Houston to ask about the itinerary requirement for entering Brazil if I will be entering by bus, and this is what they told me:
Please contact the Brazilian Consulate closest to your entry port to Brazil.
Since you do not have a rountrip ticket we cannot process your visa application at this office.
So in at least some circumstances, it is possible for a U.S. citizen to get their Brazilian visa outside of the U.S. I would suggest contacting your consulate (by email--they won't answer visa questions over the phone) with your specific plans to make sure you'll be okay, prior to leaving the U.S.
I also emailed the Consulate in Mexico City, and this was their response:
Usted sí puede tramitar su visa en la Ciudad de México, hay que traer todos los requisitos, le voy anexar la página del Consulado para que pueda verficar los documentos.
Yes you can arrange your visa in Mexico City, you must bring all the requirements, I will attach the page of the Consulate so that you can verify the documents.
I would still recommend contacting the consulate where you intend to apply for your visa, to be certain there won't be a problem.