There have been several reports on this forum of scams in ATMs in Rio, especially the ones located at the International Airport.
In view of the above:
1) Avoid using ATMs located at the airport, subway stations and other public areas;
2) When arriving at the airport, exchange only the necessary at an exchange booth, so that you can get your reais and pay for your ground transportation. Exchange booths at the airport usually have worse rates, so the suggestion we've givien is: get the necessary and withdrawl money from ATM machines as per the instructions on item #3;
3) Use ATMs located inside bank agencies around the city, especially Banco do Brasil, which apparently has shown to be more compatible with foreign cards (look for the ATM machines which have stickers of card flags – Visa, MasterCard, etc – attached to them). Citibank, HSBC and other international banks may also have compatible machines.
4) If you've been a victim of any kind of fraud, contact your bank. They usually reimburse you within some hours or days, as in most jurisdictions – including under Brazilian Law – they have to do it so, as it is their duty to keep their costumers free of frauds.
Moreover, it's also important to know that ATMs won't allow you withdrawl more than R$ 1,000 per day. In some banks, the limit may be as low as R$ 300. Also avoid withdrawing money in the evening, as some banks won't let you do it when it's late. Further information:
Remember that credit cards are widely accepted in restaurants, bars, clubs, supermarkets, etc, so you won't need to withdrawl money from ATM machines all the time.
All the best,