I believe you are making reference to the "Friends with benefits" type of situation, where people who know each other very well have sexual intercourse due to the attraction they have for each other.
When it comes to such sensitive issues, there is usually a division in opinions because the aftermath of the relationship usually depends on the parties involved. For some people, the relationship becomes much solid and smoother after such activities, whereas the friendship between others totally gets destroyed.
Usually, the friends-with-benefits type of relationship occurs under the condition of an explicit mutual understanding between the people involved because any misunderstanding could evoke chaos.
As to whether it is good to practice such relationship depends on you and your partner. What are your religious beliefs, societal and cultural norms, how old are you and your partner etc.
I think it is ok
If good, well defined and clear arrangements are made. Communication is key, and so is respect. Either one of the parties involved should do it under any, even the least, kind of pressure. And all parties involved should be and stay happy with what and how it is going on.
This does not only count for sex between friends, but for sex in general, whatever the relationship between the parties is.
Sex in a relationship should be a matter of choice.
If both parties do agree to be have sex with each other I don't see anything wrong with it provided they are both adults.
I will also advise for people to define any relationship or friendship they do find theirselves in
In my opinion, there should be no sex training in the world of friendship before someone is married first, because having sex without marriage is adultery, and adultery is the most abominable and a major sin.
I'm more of the relationship committed type when it comes to sex.
Simply put, I get attached and fall in love quite easily through sex it seems.
So hit and quit it doesn't work for a man like me.