If you are going to participate in a forum you have to make sure that you follow the rules of the forum. The owners of forums learned long ago that if they allowed people to post whatever they wanted there would be people who would take advantage of this and post things that are completely inappropriate. There are consequences if you break the rules of a forum.
The most likely consequence of breaking the forum rules is that the post that you made that broke the rules will likely be deleted. The moderators on most forums are constantly on the lookout for posts that violate the rules. Usually if you make a post that is clearly an advertisement or on a topic that is not relevant to the forum or is an attack on somebody else it will be removed. If the post that you made was one that started a new thread you can expect to have the thread deleted as well.
If you continue to break the forum rules you will probably find that you are suspended for a specified period of time. This will vary from forum to forum in how the determine whether you should be suspended and for how long. Some will suspend you for increasing periods of time for each infraction that you make. Other forums operate on a points system, you get a certain number of points for each infraction and when you have reached a certain number of points you will be suspended. In most cases if they find it necessary to suspend you more than once you will likely face harsher punishment.
If you seriously breach the rules of a forum or if you are suspended on multiple occasions you will likely find that you banned from the forum permanently. Some forums are quick to ban people who break the rules while others will only do it after multiple infractions. Regardless of how they make the decision to ban you once you are banned you will normally not be allowed to return to posting on the forum. Therefore you are going to want to make sure that you follow the rules so that this does not happen.
Getting banned from a forum is a pretty big step and one that should not be necessary. All forums will make their rules clearly available to all members and most follow rules that are fairly similar. Therefore there is really no reason that you should find yourself getting banned. Most of the rules are largely common sense and besides you will almost certainly be given warnings and suspensions beforehand. These should explain to you what rules you have broken so that you do not break them again. As long as you follow the rules as they are laid out you should have no problems.