I want to know if I can use the k-means clustering algorithm for a one class classification (as in the case of one class SVM), which means I have data for 2 classes, and I labelled only the one class that I used for training?
The K-means algorithm has the capacity of retrieving which are the "boundaries" your data has for knowing the only-class, is possible that you don't find the only-class boundaries to be the same boundaries your k-means algorithm found. This is the risk of comparing k-means with the one class classification: Clustering can be looking different things from one class classification.
This answer may guide you to another solution.
A Gaussian Mixture Model can be seen as a generalization of k-means, with soft (probabilistic) cluster assignments rather than hard ones. It can be, and often is, used in a one-class setting. It allows for multiple Gaussian components and for non-spherical shapes of clusters, which can be an advantage with many datasets. But if one restricts to single components with spherical covariance matrix, it is very similar to k-means.