What you want already exists: Formatting Sandbox.
You can 'answer' over there to test out post formatting, however you need to get 10 reputation on this site - but that isn't too hard - suggest 5 good edits/get 2 question upvotes/1 answer upvote and your past the limit.
Once you've answered over there, you can add a comment to your new answer, where you can test comment formatting :)
Although, what you mention is not really a problem - all comments have a 5 minute period where you can edit the comment, and all posts can be edited whenever you want (if you do it within 5 minutes, it won't even create a revision!). There's nothing wrong in correcting yourself! Make mistakes and learn from them :)
By the way, if you're unsure on any formatting related thing, see the Markdown editing help - it's easy to understand and there are examples for everything.