Short answer is yes. The people vote in a person not a party representative. This is why the parties have their conventions and 'endorse' a candidate - they're saying that they back this candidate as representing them, but it doesn't mean that person is their representative on the ballot, per se.
While this is true in most democracies, there is a very specific exception to this in Australia; In the Federal Senate, people can vote above the line or below the line. If they vote above the line, they're voting for the parties and their choices and order of candidates. If they vote below the line, they're voting for individuals. The thing is, less than 1% of the population in Australia vote below the line on the senate ticket. That means that the party sort of 'own' the seat.
In practice, this only matters if the person is ejected from office. If the person changes party or becomes an independent, they retain their seat. If they resign or are removed through a technicality (like direct benefit from the crown or dual-citizenship) then the party gets to choose a replacement.
In the Legislative Assembly (our lower house, similar to House of Commons or the US Congress) there are documented cases of people who have literally switched parties while in office, but it's by no means common and as said before, there's little that can be done because you're voting for a person, not their party.