“the sin of Samaria.” The “sin” of Samaria are the idols there that people worshiped. This is the figure of speech metonymy, where “sin” is put for things that cause people to sin, in this case, idols that people swear by. Samaria was the capital city of the northern kingdom of Israel and it had been a center of idolatry since it was established.
“As your god lives, O Dan.” Dan had been a center of idol worship since the time of Judges (Judg. 17-18; esp. Judg. 18:28-31). When Jeroboam I became the first king of the northern kingdom of Israel, he set up a golden calf idol in Dan (1 Kings 12:28-30).
“the Way of Beer-sheba.” This is apparently the name of an idol god in Beer-sheba. The Septuagint translators understood it that way, and translated “Way” (“Road”) as “god.” Also, that fits well with the rest of the verse. It has been suggested that “way of Beer-sheba” refers to the pilgrimage route there to worship idols, but that is less likely given the immediate context and the difficulty in having a road “live.”
Sinners and idolaters can be very arrogant and self-assured about how their “way” is right, and it makes sense that they would call an idol god “the Way.” But there is a true and proper “way.” Jesus Christ said he was “the way” to God, and indeed he was correct (John 14:6).