From the DMG page 199...
Scroll of Protection
Using an action to read the scroll encloses you in a invisible barrier that extends from you to form a 5-foot-radius, 10-foot-high cylinder. For 5 minutes, this barrier prevents creatures of the specified type from entering or affecting anything within the cylinder...
A creature can attempt to overcome the barrier by using an action to make a DC 15 Charisma check. On a success, the creature ceases to be affected by the barrier.
There's a lot of different types of spells, so I want to drill down to a specific example: Assume an efreeti casts Wall of Fire blocking a narrow corridor. Could a PC use a Scroll of Protection (elementals) and then walk through the Wall of Fire without taking damage?
If the above answer is YES: if the efreeti succeeded on its Charisma check to overcome the barrier, would the PC start being subject to damage from the Wall of Fire?