It depends on the corrosiveness and the type of rebar. Some types are not recommended because they may corrode over time and break the connection. However, some types of rebar, such as galvanized steel reber, can be used as a grounding rod.