The visibility of your comments and likes is dictated by the person/page you are liking or commenting on. If you comment on a friend's post that is visible to Friends, then all their friends will be able to see that comment. Furthermore, your comment may appear (based on Facebook's importance algorithm) in the news feeds of those friends you have in common.
This extends to any kind of visibility that the recipient of your like/comment has set. So if they have set visibility to Friends of Friends then your like/comment will be visible to their friends' friends, and once again your own friends who are in that group (your friends who are that user's friends of friends) may see it in their news feeds.
It is always important to bear in mind that it is ultimately Facebook that decides whether an item shows up in a user's news feed after the rules above have been applied, based on importance and relevance criteria.