Исправь или исправьте; история, которую я написал; Я ее написал по-русски.

Yesterday I encountered a problem. - Вчера я столкнулся с проблемой. Well, it's OK grammatically, but I really don't like it stylistically. I'd say, "Вчера со мной произошёл такой случай."

I was walking it the park, when suddenly a dog stole my pies! - Когда я гулял по парку, собака неожиданно украла у меня пироги. Two things here: 1) If you holded pies in your hands when dog got them, you'd better use "вырвала" or "выхватила" instead of "украла"; 2) "пирог" is quite big, so it doesn't sound realistic that a dog could get even one "пирог" from you, leaving alone several ones, use "пирожки" instead.

The dog was vicious too. - Собака была злая! Too in this sentance would be translated as "к тому же": "Собака к тому же была злая!" but I'd prefer to omit it here.

I wasn't able to get them from the dog! - Я не мог отобрать их у собаки!

Suddenly, I had an idea. - Вдруг у меня появилась идея.

I picked up a rock, and threw it at the dog. - Я подобрал камень и бросил его в собаку.

The dog droped by pies and ran away. - Собака бросила пирожки и убежала.