I wouldn’t generally recommend an SM57 for acoustic guitar, but it can be made to work.
As @TheMadman_tobyjenner points out, with dynamic mics like the SM57, SM58 and XM5800 you have to get the mic pretty close to the sound source to get a decent signal.
This is why they are so often used as stage mics, because they reject a lot of ambient and off-axis sound, so singers don’t get so much feedback. They don’t tend to be used as much as studio mics for singers.
Where they are used a lot in studios is for micing up guitar amps, because they can be placed close and the amp turned up loud without damaging the mic.
For studio work for recording acoustic guitars and vocals, it’s more common to use condenser mics, like the Shure SM81, or ribbon mics like the Beyerdynamic M160. These are more sensitive and capture a wider range of frequencies.
But beggars can’t be choosers and we aren’t all well-funded studios. Another factor in a home environment is we don’t have the acoustic treatment a studio has, so having sensitive microphones can result in picking up noise from traffic, air-conditioning, and so on.
I think for micing up guitar cabs, you can’t go too far wrong with the Behringer XM8500. These can also be used as vocal mics as long as you, as @TheMadman_tobyjenner said, get “up close and personal” with them.
For recording acoustic guitar, they are far from ideal, but it can be done by getting the mic nice and close. You will need to invest in some appropriate mic stands as well as cables.
Ideally, you want a mic stand with an extending boom arm for acoustic guitar recording, so you can place the mic nice and close. You might be able to get away with a simple table-top stand, but I think getting the guitar close enough whilst still being comfortable to play could be challenging.
Personally, if you are looking at an SM57/58 (or XM8500, etc.), I would recommend pairing it with a condenser mic, rather than another SM57/58 especially if you are recording acoustic guitar. If you only have two mics, then you should aim for them to be different. Two mics which are, effectively, the same model (and both dynamic) will be quite limiting.
As I said, the SM57/58 or a similar model (like the XM8500) will work great for micing a fairly loud guitar cabinet, but for vocals and acoustic guitar, something like the Lewitt LCT 240 PRO would be better, and is a good example of a decent condenser mic for not too much money.
Cheers,
Keith