Police were called to the premises of Pulse Phones, on Huddersfield Road, at midday.
A witness claimed that nearby residents tackled the would-be robber and held him until police arrived shortly afterwards. They also said one of the assailants carried a sword, the other a hammer.
The store is situated beside the town's Post Office.
A West Yorkshire Police spokesperson said: "Police were called to a shop in Dewsbury after reports of an armed robbery.
"Officers were called at 12:03 to Pulse Phone on Huddersfield Road to an ongoing disturbance.
"Suspects wearing dark clothing and face coverings entered the premises with what was thought to be a knife.
"A man has been arrested in connection with this incident and a weapon was recovered.
"No-one was injured during the incident and nothing was stolen.
"Enquiries are ongoing.
"Anyone with any information about this incident is asked to contact the police via 101 quoting crime reference number 13180556763 or information can be passed to the independent charity Crimestoppers on 0800 555 111."